#System agent not using response from function

1 messages · Page 1 of 1 (latest)

ocean jungle
#

Hi folks! I need some help with the functions feature. I have an agent that can response questions given a function. The issue is that the agent instead of using the response of the function to answer the question it is not answering like if the final user could also see the response of the function when in fact it is internal. I attach some code in thread so you can replicate and see the full prompt. Have you ever seen this behavior before? How would you fix it?

{
      "role": "assistant",
      "function_call": {
        "name": "answer_question",
        "arguments": {
          "question": "what happened in catalonia during ww2"
        }
      },
      "content": null
    },
    {
      "role": "function",
      "name": "answer_question",
      "content": "During World War II, Catalonia was part of Spain under the rule of Francisco Franco. Although Spain declared neutrality, Catalonia was affected by the conflict. Italy and Germany had some interest in Catalonia before the war, but their attempts to establish a fascist movement failed. Barcelona was bombed by Italian planes supporting the Nationalist side in the Spanish Civil War. Catalan individuals, such as Joan Pujol and Josep Trueta, played roles in the Allied side, with Pujol acting as a double agent and Trueta organizing medical services. Some Catalans also fought on the Soviet side in the Eastern Front."
    },
    {
      "role": "assistant",
      "content": "Thank you for your question about Catalonia during WWII. Now, can you tell me the time period during which World War II took place?"
    }