GPT 3.5 calling 4o instead?

I have the same problem. Can you resolve it?

You really have the same problem as a year and a half ago? Can you elaborate more, because it’s working fine here. I just blasted off 100 parallel requests and they are fulfilled and billed, not appearing to increase other model usage counts.

1 Like

Yes, I use langchain:
@app.route(“/getresponsegpt”, methods=[“GET”])
def getResponseGpt():
user_prompt = request.args.get(“user_prompt”)
embeddingGenerator = OpenAIEmbeddings()

download_embedding()

PATH_VECTORSTORE = "PdfVectorStore"
baseconocimiento = FAISS.load_local(
    PATH_VECTORSTORE + "/faiss_index",
    embeddingGenerator,
    allow_dangerous_deserialization=True
)

docs = baseconocimiento.similarity_search(user_prompt)
# Guardar los mensajes en una carpeta por usuarios
# Guardar los mensajes en un .txt de la siguiente forma por usuario:
## <numero/bot>, <hora> Mensaje
# Primero acceder al excel de deudas en el storage
# Crear los embedings
# 

template = """
Eres Emma, una asistente virtual experta en administración de cuentas Spotify. Tu objetivo es ayudar con: suscripciones, pagos, facturación, problemas técnicos y uso de la plataforma.

Contexto del usuario:
{cx 

Historial de conversación:
{chat_history}

Directrices:
1. Identifica si la consulta está relacionada con Spotify. Si no, responde: "Lo siento, solo puedo responder preguntas relacionadas con Spotify. ¿Puedes intentar de nuevo?"
2. Verifica el estado de la suscripción antes de responder sobre funcionalidades premium
3. Para consultas de pago, confirma los últimos movimientos registrados
4. En problemas técnicos, solicita información del dispositivo y versión de la app

Prioridades:
- Mantén un tono amable y profesional
- Ofrece soluciones paso a paso cuando sea necesario
- Verifica fechas y estado de la conversación
- Incluye enlaces relevantes a la documentación oficial




Cliente: {human_input}
Emma: """
prompt = PromptTemplate(
    input_variables=["context", "chat_history", "human_input"],
    template=template
)
memory = ConversationBufferMemory(
    memory_key="chat_history", 
    input_key="human_input"
)

llm = ChatOpenAI(model_name="gpt-3.5-turbo")
chain = load_qa_chain(
    llm, 
    chain_type="stuff", 
    memory=memory, 
    prompt=prompt
)

respuesta = chain.invoke({
    'input_documents': docs, 
    'human_input': user_prompt
})
print(respuesta['output_text'])

# Crear respuesta serializable
response_data = {
    'answer': respuesta['output_text'],
    'source_documents': [
        {
            'page_content': doc.page_content,
            'metadata': doc.metadata
        } for doc in docs
    ]
}

return jsonify(response_data)

if name == “main”:
app.run(host=‘0.0.0.0’, port=8508, debug=True)

And I use 3.5 but many requests later, it gives me answers as if it were the 4o or 4.5 models but I don’t know why.

look:

I could blame some strange default or replacement going on in langchain, but chatgpt-4o-latest is a weird one to have invoked in any capacity.

I would log the parameters against the model returned in responses.

Then you can see if it is your code (or langchain’s) messing up, incorrect model fulfillment despite calling correctly, or simply a billing and accounting snafu.

(BTW, if using Azure, you can name a deployment anything you want and simulate the same… :laughing:)

1 Like