"function": { "name": "GeneratedMessages", "parameters": { "$schema": "http://json-schema.org/draft-07/schema", "type": "object",
{ "error":{ "message":"Invalid JSON payload received. Unknown name \"$schema\" at 'tools[0].function_declarations[0].parameters': Cannot find field.\nInvalid JSON payload received. Unknown name \"if\" at 'tools[0].function_declarations[0].parameters.properties[0].value.items.properties[2].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"else\" at 'tools[0].function_declarations[0].parameters.properties[0].value.items.properties[2].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"definitions\" at 'tools[0].function_declarations[0].parameters': Cannot find field.", "type":"INVALID_ARGUMENT", "param":null, "code":"INVALID_ARGUMENT" }, "provider":"google" }
{"error":{"message":"Please ensure that multiturn requests ends with a user role or a function response.","type":"INVALID_ARGUMENT","param":null,"code":"INVALID_ARGUMENT"},"provider":"google"}
assistant
and user
roles$schema
field and the it jumps in the next error:{"error":{"message":"Invalid JSON payload received. Unknown name \"if\" at 'tools[0].function_declarations[0].parameters.properties[0].value.items.properties[2].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"else\" at 'tools[0].function_declarations[0].parameters.properties[0].value.items.properties[2].value': Cannot find field.\nInvalid JSON payload received. Unknown name \"definitions\" at 'tools[0].function_declarations[0].parameters': Cannot find field.","type":"INVALID_ARGUMENT","param":null,"code":"INVALID_ARGUMENT"},"provider":"google"}
private fun JsonObjectBuilder.applyJsonSchemaDefaults( descriptor: SerialDescriptor, annotations: List<Annotation>, skipNullCheck: Boolean = false, skipTypeCheck: Boolean = false ) { if (descriptor.isNullable && !skipNullCheck) { this["if"] = buildJson { it["type"] = descriptor.jsonLiteral } this["else"] = buildJson { it["type"] = "null" } } else { if (!skipTypeCheck) { this["type"] = descriptor.jsonLiteral } }
definitions
which is for the refs
in the schema so they don't repeat when nested. I'm gonna guess that whatever you using on the gateway side for json Zod
may be using a json schema version ref that is older than what I'm using.anyscale
and mistralai/Mistral-7B-Instruct-v0.1
. The gateway responds with a 422 unprocessable entity, and the following response:{"error":{"param":null,"code":null},"provider":"anyscale"}
together-ai
I get:{"error":{"message":"(unknown path)\n Error: Unable to call `content[\"trim\"]`, which is undefined or falsey","type":null,"param":null,"code":null},"provider":"together-ai"}
{ "model": "mistralai/Mistral-7B-Instruct-v0.1", "stream": false, "max_tokens": 100, "messages": [ { "role": "user", "content": "What is weather in London ? " } ], "tools": [ { "type": "function", "function": { "name": "get_current_weather", "parameters": { "type": "object", "required": [ "location" ], "properties": { "unit": { "enum": [ "celsius", "fahrenheit" ], "type": "string" }, "location": { "type": "string", "description": "The city and state, e.g. San Francisco, CA" } } }, "description": "Get the current weather in a given location" } } ] }
anyscale
looks like:{ "messages": [ { "content": [ { "text": " ...", "type": "text" } ], "role": "user" } ], "model": "mistralai/Mistral-7B-Instruct-v0.1", "max_tokens": 500, "temperature": 0.4, "user": "user" }
{"error":{"param":null,"code":null},"provider":"anyscale"}
{"error":{"message":"(unknown path)\n Error: Unable to call `content[\"trim\"]`, which is undefined or falsey","type":null,"param":null,"code":null},"provider":"together-ai"}
"messages": [ { "role": "user", "content": "Hello world" } ]
string
based on the openAI spec. We generate our client from the yaml spec file and it works in that format with OpenAI fine.ChatCompletionRequestUserMessage
:ChatCompletionRequestMessage: oneOf: - $ref: "#/components/schemas/ChatCompletionRequestSystemMessage" - $ref: "#/components/schemas/ChatCompletionRequestUserMessage" - $ref: "#/components/schemas/ChatCompletionRequestAssistantMessage" - $ref: "#/components/schemas/ChatCompletionRequestToolMessage" - $ref: "#/components/schemas/ChatCompletionRequestFunctionMessage"
ChatCompletionRequestMessage
has multiple types and we can't control how our users want to structure the message as we publicly export the OpenAI client.