#Why is it not summarizing the entire conversation

5 messages · Page 1 of 1 (latest)

nimble jasper
#
    messages.insert(0, {"role": "system", "content": "The following conversation is between you and user, but it's too long. Your task is to return a good summary of the conversation so that you can continue the conversation by just using this summary. Include any important and relevant information about the conversation and the user. Make sure to look at the entire conversation."},)
    print(f'line 180  {messages}')
    function_descriptions = [
        {
            "name": "summarize_conversation",
            "description": "Summarizes the entire current conversation. Include any important and relevant information about the conversation and the user",
            "parameters": {
                "type": "object",
                "properties": {
                    "summary": {
                        "type": "string",
                        "description": "Your summary of the entire current conversation",
                    },
                },
                "required": ["summary"],
            },
        }
    ]
    response = openai.ChatCompletion.create(
        model="gpt-3.5-turbo",
        messages=messages,
        functions=function_descriptions,
        function_call={"name": "summarize_conversation"}
    )
    return json.loads(response["choices"][0]["message"]['function_call']['arguments'])['summary']``` I use this code to summarize a list of messages and i can see it recieves all the messages, but it only summarize the last message?
nimble jasper
#

help me lmfao

#

plz bruh

wide ibex
#

I assume those messages are part of the same conversation? If that’s the case, you need to include the history of the other messages.

nimble jasper