#Compatibilité OpenAI  |  Gemini API  |  ...

1 messages · Page 1 of 1 (latest)

nova barn
#

But I get a 400 response when I provide the function result

#

The example in the documentation doesn't cover the function response

#

Here is the messages object I provide in the call:

#
  {
    "role": "system",
    "content": "My system prompt"
  },
  {
    "role": "user",
    "content": "number of customers using xxx"
  },
  {
    "role": "assistant",
    "tool_calls": [
      {
        "function": {
          "arguments": "{\"query\":\"\\n[\\n    {\\n        \\\"$match\\\": {\\n            \\\"kind\\\": \\\"xxx\\\"\\n        }\\n    },\\n    {\\n        \\\"$group\\\": {\\n            \\\"_id\\\": \\\"$customer\\\",\\n            \\\"count\\\": {\\n                \\\"$sum\\\": 1\\n            }\\n        }\\n    },\\n    {\\n        \\\"$count\\\": \\\"total\\\"\\n    }\\n]\\n\"}",
          "name": "execute_mongo_aggregate_query"
        },
        "id": "0",
        "type": "function"
      }
    ]
  },
  {
    "role": "tool",
    "content": "{\"data\":[{\"total\":24}]}",
    "tool_call_id": "0"
  }
]```