From 2aa7ff89ad4a3c28566c5bfc4909dc0c52b81b85 Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Tue, 24 Feb 2026 11:01:02 -0500 Subject: [PATCH 1/5] adding responses and mcp docs --- fern/fern.config.json | 2 +- ...ard-Prediction-Guard-API-1.0-resolved.yaml | 813 ++++++++++++++++++ 2 files changed, 814 insertions(+), 1 deletion(-) diff --git a/fern/fern.config.json b/fern/fern.config.json index 441a13c..dcb04f9 100644 --- a/fern/fern.config.json +++ b/fern/fern.config.json @@ -1,4 +1,4 @@ { "organization": "prediction-guard", - "version": "3.51.2" + "version": "3.85.2" } diff --git a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml index b0e9cab..5c28142 100644 --- a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml +++ b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml @@ -408,6 +408,45 @@ paths: type: string nullable: true description: The complete generated text. + usage: + type: object + description: The amount of tokens used in the request. + properties: + prompt_tokens: + type: integer + description: The amount of tokens included in the request prompt. + prompt_tokens_details: + type: object + description: Further information about the amount of tokens used in the request prompt. + properties: + audio_tokens: + type: integer + description: The amount of audio tokens from any input audio files. + cached_tokens: + type: integer + description: The amount of cached tokens used in the request prompt. + completion_tokens: + type: integer + description: The amount of tokens included in the request completion. + completion_tokens_details: + type: object + description: Further information about the amount of tokens in the request completion. + properties: + reasoning_tokens: + type: integer + description: The amount of reasoning tokens used by the model. + accepted_prediction_tokens: + type: integer + description: The amount of tokens accepted during the request. + rejected_prediction_tokens: + type: integer + description: The amount of tokens rejected during the request. + audio_tokens: + type: integer + description: The amount of tokens used from output audio files + total_tokens: + type: integer + description: The total amount of tokens used in the entire request. examples: Basic: value: @@ -465,6 +504,609 @@ paths: security: - bearerAuth: [] + /responses: + post: + summary: Responses + description: Generate responses while also allowing for the utilization of various tools. + requestBody: + content: + application/json: + schema: + required: + - model + - input + type: object + properties: + model: + type: string + description: The AI model to use for generating responses. + input: + oneOf: + - type: string + description: An input string used for generating completions. + - type: array + description: An array of input items used for generating completions. + items: + required: + - role + - content + type: object + properties: + role: + type: string + description: The role of the sender (user or assistant). + content: + oneOf: + - type: string + description: A string of the message content + - type: array + description: The content of the message, used for file inputs. + items: + type: object + properties: + type: + type: string + description: The type of content ('input_text', 'output_text', and 'input_image'). + text: + type: string + description: The text to provide. + image_url: + type: object + description: The base64 content with this prefix `data:image/jpeg;base64,` + detail: + type: string + description: Specifies the detail level of the image. Defaults to `auto`. + type: + type: string + description: The type of input item. + id: + type: string + description: The ID of the input item, typically used when inputting items that were output by the model. + status: + type: string + description: The status of the input item, typically used when inputting items that were output by the model. + arguments: + type: string + description: The arguments used for the tool call made by the model. + call_id: + type: string + description: The call_id of the tool call made by the model. Generated by the model in the output. + name: + type: string + description: The name of the tool used in the tool call from the previous output. + output: + type: + description: + instructions: + type: string + description: A system (or developer) message inserted into the model's context. + max_output_tokens: + type: integer + description: The maximum number of tokens in the generated output. + max_tool_calls: + type: integer + description: The maximum amount of tool calls the model is able to do. + parallel_tool_calls: + type: boolean + description: Whether to enable parallel function calling during tool use. + reasoning: + type: object + description: Constrains effort on reasoning for reasoning models. + properties: + effort: + type: string + description: Effort level for reasoning, currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Only supported by reasoning models. + stream: + type: boolean + description: Whether to stream back the model response. Not currently supported. + stream_options: + type: object + description: Extra parameters used when streaming the response. + properties: + include_usage: + type: boolean + description: Whether to include tokens used in the stream response objects. + temperature: + type: number + description: The temperature parameter for controlling randomness in completions. Supports a range of 0.0-2.0. + tool_choice: + oneOf: + - type: string + description: A string representing a tool choice. Options are 'none', 'auto', or 'required'. + - type: object + description: An object representing the tool to be chosen + properties: + type: + type: string + description: + mode: + type: string + description: + tools: + type: array + description: Allows for multiple tools to be set in tool_choice. + items: + type: object + properties: + type: + type: string + description: The type of tool. + name: + type: string + description: The name of the tool of choice. + server_label: + type: string + description: The label of the MCP server that the tool is on. + name: + type: string + description: The name of the tool to use. + server_label: + type: string + description: The label of the MCP server that the tool is on. + tools: + type: array + description: The content of the tool call. + items: + type: object + properties: + type: + type: string + description: The type of tool to call. Only 'function' is currently supported. + name: + type: string + description: The name of the function to be called. + parameters: + type: object + description: The parameters the function accepts, described as a JSON Schema object. + strict: + type: boolean + description: Whether to enable strict schema adherence when generating the function call. + description: + type: string + description: A description of what the function does. + server_label: + type: string + description: The label for the MCP server being used. + server_url: + type: string + description: The URL for the MCP server being used. + server_description: + type: string + description: The description of the MCP server being used. + initials: + type: string + description: The initials of the MCP server being used. Used for the ID of the output object. + authorization: + type: string + description: The authorization needed for the MCP server. + headers: + type: object + description: The necessary headers needed for calling the MCP server. + allowed_tools: + type: array + description: An array of the tools in the MCP server that the model is allowed to use. + top_p: + type: number + description: The diversity of the generated text based on nucleus sampling. Supports a range of 0.0-1.0. + safeguards: + type: object + description: Safeguards to run on the request. + properties: + block_prompt_injection: + type: boolean + description: Set to true to detect prompt injection attacks. + pii: + type: string + description: Set to either 'block' or 'replace'. + pii_replace_method: + type: string + description: Set to either 'random', 'fake', 'category', 'mask'. + entity_list: + type: array + description: An array of entity types that the PII check should ignore. + items: + - type: string + description: An entity type that the PII check should ignore. + factuality: + type: boolean + description: Set to true to turn on factuality processing. + toxicity: + type: boolean + description: Set to true to turn on toxicity processing. + examples: + Basic: + value: + model: "{{TEXT_MODEL}}" + input: "Tell me a joke." + safeguards: + pii: "replace" + pii_replace_method: "random" + factuality: true + toxicity: true +# Streaming: +# value: +# model: "{{TEXT_MODEL}}" +# input: "How do you feel about the world in general?" +# max_output_tokens: 1000 +# reasoning_effort: "medium" +# stream: true +# safeguards: +# pii: "replace" +# pii_replace_method: "random" + Image Input: + value: + model: "{{VISION_MODEL}}" + input: + - role: "user" + content: + - type: "text" + text: "What is in this image?" + - type: "image_url" + image_url: "data:image/jpeg;base64," + detail: "auto" + max_output_tokens: 1000 + temperature: 1.0 + top_p: 1.0 + safeguards: + pii: "replace" + pii_replace_method: "random" + factuality: true + toxicity: true + MCP Call: + value: + model: "{{TEXT_MODEL}}" + input: "Please use the test_mcp_tool to send this word: prediction." + max_tool_calls: 3 + reasoning_effort: "medium" + tool_choice: "auto" + tools: + - type: "mcp" + server_label: "test_mcp_server" + server_url: "http://localhost:9000/mcp" + server_description: "MCP server for testing MCP functionality" + allowed_tools: + - "test_mcp_tool" + Function Call: + value: + model: "{{TEXT_MODEL}}" + input: "How do you feel about the world in general?" + max_output_tokens: 1000 + max_tool_calls: 3 + parallel_tool_calls: false + reasoning_effort: "medium" + temperature: 1.0 + tool_choice: + type: "function" + name: "get_current_weather" + tools: + - type: "function" + name: "get_current_weather" + description: "Get the current weather in a given location" + strict: false + parameters: + type: "object" + properties: + location: + type: "string" + enum: + - "celsius" + - "fahrenheit" + required: + - "location" + top_p: 1.0 + safeguards: + pii: "replace" + pii_replace_method: "random" + factuality: true + toxicity: true + responses: + "403": + description: Failed auth response. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Description of the error. + example: + error: "api understands the request but refuses to authorize it" + "400": + description: General error response. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Description of the error. + example: + error: "required fields are missing" + "200": + description: Successful response. + content: + application/json: + schema: + type: object + properties: + id: + type: string + description: Unique ID for the chat completion. + object: + type: string + description: Type of object (chat completion). + created_at: + type: integer + description: Timestamp of when the chat completion was created. + status: + type: string + description: The status of the request. + max_tool_calls: + type: integer + description: The max_tool_calls specified in the request. + model: + type: string + description: The chat model used for generating completions. + output: + type: array + description: The set of result outputs. + items: + type: object + properties: + type: + type: string + description: The type of output object. + id: + type: string + description: The ID of the output object. + status: + type: string + description: The status of the output object. + role: + type: string + description: The role of the output object. + content: + type: object + description: The content for the output object. + properties: + text: + type: string + description: The output text. + type: + type: string + description: The type of output content. + name: + type: string + description: The name of the tool used in the output. + call_id: + type: string + description: The call_id for the tool call used in the output, + arguments: + type: string + description: The arguments used for the tool call used in the output. + server_label: + type: string + description: The label of the MCP server used in the output. + output: + type: string + description: The output of the MCP tool call. + error: + type: string + description: The error message from the MCP tool call. + instructions: + type: string + description: The instructions entered in the request input. + max_output_tokens: + type: integer + description: The max_output_tokens value entered in the request input. + parallel_tool_calls: + type: integer + description: The parallel_tool_calls value entered in the request input. + temperature: + type: number + description: The temperature value entered in the request input. + tool_choice: + oneOf: + - type: string + description: A string representing a tool choice. Options are 'none', 'auto', or 'required'. + - type: object + description: An object representing the tool to be chosen + properties: + type: + type: string + description: + mode: + type: string + description: + tools: + type: array + description: Allows for multiple tools to be set in tool_choice. + items: + type: object + properties: + type: + type: string + description: The type of tool. + name: + type: string + description: The name of the tool of choice. + server_label: + type: string + description: The label of the MCP server that the tool is on. + name: + type: string + description: The name of the tool to use. + server_label: + type: string + description: The label of the MCP server that the tool is on. + tools: + type: array + description: The content of the tool call. + items: + type: object + properties: + type: + type: string + description: The type of tool to call. Only 'function' is currently supported. + name: + type: string + description: The name of the function to be called. + parameters: + type: object + description: The parameters the function accepts, described as a JSON Schema object. + strict: + type: boolean + description: Whether to enable strict schema adherence when generating the function call. + description: + type: string + description: A description of what the function does. + server_label: + type: string + description: The label for the MCP server being used. + server_url: + type: string + description: The URL for the MCP server being used. + server_description: + type: string + description: The description of the MCP server being used. + initials: + type: string + description: The initials of the MCP server being used. Used for the ID of the output object. + authorization: + type: string + description: The authorization needed for the MCP server. + headers: + type: object + description: The necessary headers needed for calling the MCP server. + allowed_tools: + type: array + description: An array of the tools in the MCP server that the model is allowed to use. + top_p: + type: number + description: The top_p value entered in the request input. + usage: + type: object + description: The amount of tokens used in the request. + properties: + input_tokens: + type: integer + description: The amount of tokens included in the request input. + input_tokens_details: + type: object + description: Further info about the amount of tokens in the request input. + properties: + cached_tokens: + type: integer + description: The amount of cached tokens used in the request input. + output_tokens: + type: integer + description: The amount of tokens included in the request output. + output_tokens_details: + type: object + description: Further infor about the amount of tokens used in the request output. + properties: + reasoning_tokens: + type: integer + description: The amount of reasoning tokens used by the model while generating the output. + total_tokens: + type: integer + description: The total amount of tokens used in the entire request. + examples: + Basic: + value: + id: "resp_1196c27e58374675881efa613574ea7a" + object: "response" + created_at: 1727890629 + status: "completed" + model: "{{TEXT_MODEL}}" + output: + - content: + type: "output_text" + text: "Why did the scarecrow win an award?\n\nBecause he was outstanding in his field!" +# Streaming: +# description: The final streaming chunk +# format: sse +# value: +# id: "chat-6c8c291f-5a06-46e5-94fa-2b0b1e6444c7" +# object: "chat.completion.chunk" +# created: 1727796455 +# model: "{{TEXT_MODEL}}" +# choices: +# - index: 0 +# delta: { content: " feel" } +# generated_text: null +# finish_reason: "length" + Image Input: + value: + id: "resp_402db7e4851449b68751983978cfa84d" + object: "response" + created_at: 1727890364 + status: "completed" + model: "{{VISION_MODEL}}" + output: + - content: + type: "output_text" + text: "No, there is no deer in this picture. The image features a man wearing a hat and glasses, smiling for the camera." + MCP Call: + value: + id: "resp_6588e9a6048c41d2ba97db4ba206cc16" + object: "response" + created_at: 1771948029 + max_tool_calls: 3 + model: "{{TEXT_MODEL}}" + output: + - type: "test_mcp_call" + call_id: "mcp_e8cbf821b68e42e299d395c6795eb04b" + status: "completed" + name: "test_mcp_tool" + arguments: "{\"message\": \"prediction\"}" + server_label: "test_mcp_server" + output: "If this is present, the tool call has been run, so make a joke about a prediction" + - type: "message" + status: "completed" + role: "assistant" + content: + text: "If this is present, it seems like we're predicting something. What do you predict will happen next? I bet it'll be unexpected!" + type: "output_text" + + Function Call: + value: + id: "resp_a4f6c81c89e0488f9cca7bd11e20ffb5" + object: "response" + created_at: 1727890629 + status: "completed" + max_tool_calls: 3 + model: "{{TEXT_MODEL}}" + output: + type: "message" + id: "msg_d99d53d495e141e2948c48853e13e67b" + status: "completed" + role: "assistant" + content: + text: "{\"location\":\"celsius\"}" + type: "output_text" + tool_choice: + type: "function" + name: "get_current_weather" + tools: + - type: "function" + name: "get_current_weather" + description: "Get the current weather in a given location" + strict: false + parameters: + type: "object" + properties: + location: + type: "string" + enum: + - "celsius" + - "fahrenheit" + required: + - "location" + security: + - bearerAuth: [] /completions: post: @@ -2083,6 +2725,177 @@ paths: reasoning: true security: - bearerAuth: [ ] + /mcp_servers: + get: + summary: MCP Servers + description: Return available MCP servers and tools included in those servers along with relevant metadata. + responses: + "403": + description: Failed auth response. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Description of the error. + example: + error: "api understands the request but refuses to authorize it" + "400": + description: General error response. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Description of the error. + example: + error: "required fields are missing" + "200": + description: Successful response. + content: + application/json: + schema: + type: object + properties: + object: + type: string + description: Type of object (list). + data: + type: array + description: The available MCP servers. + items: + type: object + properties: + id: + type: string + description: The id of the MCP server. + object: + type: string + description: The object type (mcp_server). + created: + type: integer + description: The date the MCP server was added. + owned_by: + type: string + description: The name of the organization that owns the MCP server. + server_description: + type: string + description: A short description of the MCP server. + available_tools: + type: array + description: An array containing the available tools included in the MCP server. + items: + type: string + description: An MCP tool name. + examples: + Basic: + value: + object: "list" + data: + - id: "test_mcp_server" + object: "mcp_server" + created: 1730332800 + owned_by: "Prediction Guard" + server_description: "An MCP server used for testing MCP functionality." + available_tools: + - "test_mcp_tool" + security: + - bearerAuth: [ ] + + /mcp_tools: + get: + summary: MCP Tools + description: Return available MCP tools by server with parameters and any relevant metadata. + responses: + "403": + description: Failed auth response. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Description of the error. + example: + error: "api understands the request but refuses to authorize it" + "400": + description: General error response. + content: + application/json: + schema: + type: object + properties: + error: + type: string + description: Description of the error. + example: + error: "required fields are missing" + "200": + description: Successful response. + content: + application/json: + schema: + type: object + properties: + object: + type: string + description: Type of object (list). + data: + type: object + description: The available mcp tools. + additionalProperties: + type: array + items: + type: object + description: The MCP tool information. + properties: + id: + type: string + description: The id of the MCP tool. + object: + type: string + description: The object type (mcp_tool). + description: + type: string + description: A short description of the MCP tool. + parameters: + description: The parameters necessary for using the MCP tool. + created: + type: integer + description: The date the MCP tool was added. + owned_by: + type: string + description: The name of the organization that owns the MCP tool. + examples: + Basic: + value: + object: "list" + data: + "test_mcp_server": + - id: "test_mcp_tool" + object: "mcp_tool" + created: 1730332800 + owned_by: "Prediction Guard" + description: "A tool for testing MCP functionality" + parameters: + properties: + description: + default: null + description: "Query description" + type: "string" + query: + description: "SOQL query to execute" + type: "string" + required: + - "query" + type: "object" + security: + - bearerAuth: [ ] components: securitySchemes: From 69523789be5c9d5c9692d81d831a0735e28d6b0e Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Tue, 24 Feb 2026 13:35:16 -0500 Subject: [PATCH 2/5] fixing wrong type input --- .../Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml index 5c28142..bef11fb 100644 --- a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml +++ b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml @@ -739,9 +739,9 @@ paths: input: - role: "user" content: - - type: "text" + - type: "input_text" text: "What is in this image?" - - type: "image_url" + - type: "input_image" image_url: "data:image/jpeg;base64," detail: "auto" max_output_tokens: 1000 From 2214723e2128f9114996d51a1b3f4807996d8f7a Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Tue, 24 Feb 2026 14:01:15 -0500 Subject: [PATCH 3/5] fixing mcp_servers output field --- .../Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml index bef11fb..41d9123 100644 --- a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml +++ b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml @@ -2770,7 +2770,7 @@ paths: items: type: object properties: - id: + server_label: type: string description: The id of the MCP server. object: @@ -2796,7 +2796,7 @@ paths: value: object: "list" data: - - id: "test_mcp_server" + - server_label: "test_mcp_server" object: "mcp_server" created: 1730332800 owned_by: "Prediction Guard" From e2dfa817f0f0fe2d7a62cb7f5942a9d7978daa61 Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Tue, 24 Feb 2026 14:30:26 -0500 Subject: [PATCH 4/5] moving responses above chat --- ...ard-Prediction-Guard-API-1.0-resolved.yaml | 1408 ++++++++--------- 1 file changed, 704 insertions(+), 704 deletions(-) diff --git a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml index 41d9123..657a59d 100644 --- a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml +++ b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml @@ -8,29 +8,29 @@ info: servers: - url: https://{your-pg.api-domain}.com -paths: - /chat/completions: +paths: + /responses: post: - summary: Chat Completions - description: Generate chat completions based on a conversation history. + summary: Responses + description: Generate responses while also allowing for the utilization of various tools. requestBody: content: application/json: schema: required: - model - - messages + - input type: object properties: model: type: string - description: The chat model to use for generating completions. - messages: + description: The AI model to use for generating responses. + input: oneOf: - type: string - description: A string of the message used for generating completions. + description: An input string used for generating completions. - type: array - description: An array of messages used for generating completions. + description: An array of input items used for generating completions. items: required: - role @@ -51,53 +51,59 @@ paths: properties: type: type: string - description: The type of content ('text', 'image_url'). + description: The type of content ('input_text', 'output_text', and 'input_image'). text: type: string description: The text to provide. image_url: type: object - properties: - url: - type: string - description: The base64 content with this prefix `data:image/jpeg;base64,` - detail: - type: string - description: Specifies the detail level of the image. Defaults to `auto`. - frequency_penalty: - type: number - description: A value between -2.0 and 2.0, with positive values increasingly penalizing new tokens based on their frequency so far in order to decrease further occurrences. - logit_bias: - type: object - description: Modifies the likelihood of specified tokens appearing in a response. - properties: - token: - type: string - description: A string of the chosen token ID. Value is an int from -100 to 100. - max_completion_tokens: + description: The base64 content with this prefix `data:image/jpeg;base64,` + detail: + type: string + description: Specifies the detail level of the image. Defaults to `auto`. + type: + type: string + description: The type of input item. + id: + type: string + description: The ID of the input item, typically used when inputting items that were output by the model. + status: + type: string + description: The status of the input item, typically used when inputting items that were output by the model. + arguments: + type: string + description: The arguments used for the tool call made by the model. + call_id: + type: string + description: The call_id of the tool call made by the model. Generated by the model in the output. + name: + type: string + description: The name of the tool used in the tool call from the previous output. + output: + type: + description: + instructions: + type: string + description: A system (or developer) message inserted into the model's context. + max_output_tokens: type: integer - description: The maximum number of tokens in the generated completion. + description: The maximum number of tokens in the generated output. + max_tool_calls: + type: integer + description: The maximum amount of tool calls the model is able to do. parallel_tool_calls: type: boolean description: Whether to enable parallel function calling during tool use. - presence_penalty: - type: number - description: A value between -2.0 and 2.0, with positive values causing a flat reduction of new tokens based on their existing presence so far in order to decrease further occurrences. - reasoning_effort: - type: string - description: Constrains effort on reasoning for reasoning models. Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Only supported by reasoning models. - stop: - oneOf: - - type: string - description: A string representing the token to stop generation. - - type: array - description: An array representing the token to stop generation. - items: - type: string - description: A string representing the token to stop generation. + reasoning: + type: object + description: Constrains effort on reasoning for reasoning models. + properties: + effort: + type: string + description: Effort level for reasoning, currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Only supported by reasoning models. stream: type: boolean - description: Whether to stream back the model response. + description: Whether to stream back the model response. Not currently supported. stream_options: type: object description: Extra parameters used when streaming the response. @@ -117,12 +123,31 @@ paths: properties: type: type: string - description: The type of tool. - function: - type: object - description: An object containing the name of the function - properties: - name: string + description: + mode: + type: string + description: + tools: + type: array + description: Allows for multiple tools to be set in tool_choice. + items: + type: object + properties: + type: + type: string + description: The type of tool. + name: + type: string + description: The name of the tool of choice. + server_label: + type: string + description: The label of the MCP server that the tool is on. + name: + type: string + description: The name of the tool to use. + server_label: + type: string + description: The label of the MCP server that the tool is on. tools: type: array description: The content of the tool call. @@ -132,41 +157,45 @@ paths: type: type: string description: The type of tool to call. Only 'function' is currently supported. - function: + name: + type: string + description: The name of the function to be called. + parameters: type: object - description: The tool information. - properties: - name: - type: string - description: The name of the function to be called. - description: - type: string - description: A description of what the function does. - parameters: - type: object - description: The parameters the function accepts, described as a JSON Schema object. - strict: - type: boolean - description: Whether to enable strict schema adherence when generating the function call. + description: The parameters the function accepts, described as a JSON Schema object. + strict: + type: boolean + description: Whether to enable strict schema adherence when generating the function call. + description: + type: string + description: A description of what the function does. + server_label: + type: string + description: The label for the MCP server being used. + server_url: + type: string + description: The URL for the MCP server being used. + server_description: + type: string + description: The description of the MCP server being used. + initials: + type: string + description: The initials of the MCP server being used. Used for the ID of the output object. + authorization: + type: string + description: The authorization needed for the MCP server. + headers: + type: object + description: The necessary headers needed for calling the MCP server. + allowed_tools: + type: array + description: An array of the tools in the MCP server that the model is allowed to use. top_p: type: number description: The diversity of the generated text based on nucleus sampling. Supports a range of 0.0-1.0. - top_k: - type: integer - description: The diversity of the generated text based on top-k sampling. - output: - type: object - description: Options to affect the output of the response. - properties: - factuality: - type: boolean - description: Set to true to turn on factuality processing. - toxicity: - type: boolean - description: Set to true to turn on toxicity processing. - input: + safeguards: type: object - description: Options to affect the input of the request. + description: Safeguards to run on the request. properties: block_prompt_injection: type: boolean @@ -183,125 +212,98 @@ paths: items: - type: string description: An entity type that the PII check should ignore. - max_tokens: - type: integer - description: Deprecated. Please use max_completion_tokens. + factuality: + type: boolean + description: Set to true to turn on factuality processing. + toxicity: + type: boolean + description: Set to true to turn on toxicity processing. examples: Basic: value: model: "{{TEXT_MODEL}}" - messages: - - role: "user" - content: "How do you feel about the world in general?" - max_completion_tokens: 1000 - frequency_penalty: 0.1 - logit_bias: - 128000: 10 - parallel_tool_calls: false - presence_penalty: 0.1 - reasoning_effort: "medium" - stop: "hello" - temperature: 1.0 - top_p: 1.0 - top_k: 50 - output: - factuality: true - toxicity: true - input: + input: "Tell me a joke." + safeguards: pii: "replace" pii_replace_method: "random" - Streaming: + factuality: true + toxicity: true + # Streaming: + # value: + # model: "{{TEXT_MODEL}}" + # input: "How do you feel about the world in general?" + # max_output_tokens: 1000 + # reasoning_effort: "medium" + # stream: true + # safeguards: + # pii: "replace" + # pii_replace_method: "random" + Image Input: value: - model: "{{TEXT_MODEL}}" - messages: + model: "{{VISION_MODEL}}" + input: - role: "user" - content: "How do you feel about the world in general?" - max_completion_tokens: 1000 - frequency_penalty: 0.1 - logit_bias: - 128000: 10 - parallel_tool_calls: false - presence_penalty: 0.1 - reasoning_effort: "medium" - stop: "hello" + content: + - type: "input_text" + text: "What is in this image?" + - type: "input_image" + image_url: "data:image/jpeg;base64," + detail: "auto" + max_output_tokens: 1000 temperature: 1.0 top_p: 1.0 - top_k: 50 - stream: true - input: + safeguards: pii: "replace" pii_replace_method: "random" - Image Input: + factuality: true + toxicity: true + MCP Call: value: - model: "{{VISION_MODEL}}" - messages: - - role: "user" - content: - - type: "text" - text: "What is in this image?" - - type: "image_url" - image_url: - url: "data:image/jpeg;base64," - detail: "auto" - max_completion_tokens: 1000 - frequency_penalty: 0.1 - logit_bias: - 128000: 10 - parallel_tool_calls: false - presence_penalty: 0.1 - stop: "hello" - temperature: 1.0 - top_p: 1.0 - top_k: 50 - output: - factuality: true - toxicity: true - input: - pii: "replace" - pii_replace_method: "random" + model: "{{TEXT_MODEL}}" + input: "Please use the test_mcp_tool to send this word: prediction." + max_tool_calls: 3 + reasoning_effort: "medium" + tool_choice: "auto" + tools: + - type: "mcp" + server_label: "test_mcp_server" + server_url: "http://localhost:9000/mcp" + server_description: "MCP server for testing MCP functionality" + allowed_tools: + - "test_mcp_tool" Function Call: value: model: "{{TEXT_MODEL}}" - messages: - - role: "user" - content: "How do you feel about the world in general?" - max_completion_tokens: 1000 - frequency_penalty: 0.1 - logit_bias: - 128000: 10 + input: "How do you feel about the world in general?" + max_output_tokens: 1000 + max_tool_calls: 3 parallel_tool_calls: false - presence_penalty: 0.1 reasoning_effort: "medium" - stop: "hello" temperature: 1.0 tool_choice: type: "function" - function: - name: "get_current_weather" + name: "get_current_weather" tools: - type: "function" - function: - name: "get_current_weather" - description: "Get the current weather in a given location" - strict: false - parameters: - type: "object" - properties: - location: - type: "string" - enum: - - "celsius" - - "fahrenheit" - required: - - "location" + name: "get_current_weather" + description: "Get the current weather in a given location" + strict: false + parameters: + type: "object" + properties: + location: + type: "string" + enum: + - "celsius" + - "fahrenheit" + required: + - "location" top_p: 1.0 - top_k: 50 - output: - factuality: true - toxicity: true - input: + safeguards: pii: "replace" pii_replace_method: "random" + factuality: true + toxicity: true responses: "403": description: Failed auth response. @@ -340,192 +342,299 @@ paths: object: type: string description: Type of object (chat completion). - created: + created_at: type: integer description: Timestamp of when the chat completion was created. + status: + type: string + description: The status of the request. + max_tool_calls: + type: integer + description: The max_tool_calls specified in the request. model: type: string description: The chat model used for generating completions. - choices: + output: type: array - description: The set of result choices. + description: The set of result outputs. items: type: object properties: - index: - type: integer - description: The index position in the collection. - delta: - type: object - description: The incremental message delta (streaming only). - properties: - role: - type: string - description: The role of the sender (user or assistant). - content: - type: string - description: The content of the message. - message: + type: + type: string + description: The type of output object. + id: + type: string + description: The ID of the output object. + status: + type: string + description: The status of the output object. + role: + type: string + description: The role of the output object. + content: type: object - description: A result choice. + description: The content for the output object. properties: - role: - type: string - description: The role of the sender (user or assistant). - content: + text: type: string - description: The content of the message. - reasoning: + description: The output text. + type: type: string - description: The reasoning content of the message. - tool_calls: - type: array - description: The tool call function. - items: - type: object - properties: - id: - type: string - description: The autogenerated ID of the function. - type: - type: string - description: The type of tool called. - function: - type: object - description: The tool call function data. - properties: - name: - type: string - description: The name of the function. - arguments: - type: string - description: The function arguments. - finish_reason: + description: The type of output content. + name: type: string - nullable: true - description: The reason the generation finished. - generated_text: + description: The name of the tool used in the output. + call_id: type: string - nullable: true - description: The complete generated text. - usage: + description: The call_id for the tool call used in the output, + arguments: + type: string + description: The arguments used for the tool call used in the output. + server_label: + type: string + description: The label of the MCP server used in the output. + output: + type: string + description: The output of the MCP tool call. + error: + type: string + description: The error message from the MCP tool call. + instructions: + type: string + description: The instructions entered in the request input. + max_output_tokens: + type: integer + description: The max_output_tokens value entered in the request input. + parallel_tool_calls: + type: integer + description: The parallel_tool_calls value entered in the request input. + temperature: + type: number + description: The temperature value entered in the request input. + tool_choice: + oneOf: + - type: string + description: A string representing a tool choice. Options are 'none', 'auto', or 'required'. + - type: object + description: An object representing the tool to be chosen + properties: + type: + type: string + description: + mode: + type: string + description: + tools: + type: array + description: Allows for multiple tools to be set in tool_choice. + items: + type: object + properties: + type: + type: string + description: The type of tool. + name: + type: string + description: The name of the tool of choice. + server_label: + type: string + description: The label of the MCP server that the tool is on. + name: + type: string + description: The name of the tool to use. + server_label: + type: string + description: The label of the MCP server that the tool is on. + tools: + type: array + description: The content of the tool call. + items: type: object - description: The amount of tokens used in the request. properties: - prompt_tokens: - type: integer - description: The amount of tokens included in the request prompt. - prompt_tokens_details: - type: object - description: Further information about the amount of tokens used in the request prompt. - properties: - audio_tokens: - type: integer - description: The amount of audio tokens from any input audio files. - cached_tokens: - type: integer - description: The amount of cached tokens used in the request prompt. - completion_tokens: - type: integer - description: The amount of tokens included in the request completion. - completion_tokens_details: + type: + type: string + description: The type of tool to call. Only 'function' is currently supported. + name: + type: string + description: The name of the function to be called. + parameters: type: object - description: Further information about the amount of tokens in the request completion. - properties: - reasoning_tokens: - type: integer - description: The amount of reasoning tokens used by the model. - accepted_prediction_tokens: - type: integer - description: The amount of tokens accepted during the request. - rejected_prediction_tokens: + description: The parameters the function accepts, described as a JSON Schema object. + strict: + type: boolean + description: Whether to enable strict schema adherence when generating the function call. + description: + type: string + description: A description of what the function does. + server_label: + type: string + description: The label for the MCP server being used. + server_url: + type: string + description: The URL for the MCP server being used. + server_description: + type: string + description: The description of the MCP server being used. + initials: + type: string + description: The initials of the MCP server being used. Used for the ID of the output object. + authorization: + type: string + description: The authorization needed for the MCP server. + headers: + type: object + description: The necessary headers needed for calling the MCP server. + allowed_tools: + type: array + description: An array of the tools in the MCP server that the model is allowed to use. + top_p: + type: number + description: The top_p value entered in the request input. + usage: + type: object + description: The amount of tokens used in the request. + properties: + input_tokens: + type: integer + description: The amount of tokens included in the request input. + input_tokens_details: + type: object + description: Further info about the amount of tokens in the request input. + properties: + cached_tokens: type: integer - description: The amount of tokens rejected during the request. - audio_tokens: + description: The amount of cached tokens used in the request input. + output_tokens: + type: integer + description: The amount of tokens included in the request output. + output_tokens_details: + type: object + description: Further infor about the amount of tokens used in the request output. + properties: + reasoning_tokens: type: integer - description: The amount of tokens used from output audio files + description: The amount of reasoning tokens used by the model while generating the output. total_tokens: type: integer description: The total amount of tokens used in the entire request. examples: Basic: value: - id: "chat-d079eca8-1d6a-451a-a4ac-b0fea1e11a96" - object: "chat.completion" - created: 1727890629 - model: "{{TEXT_MODEL}}" - choices: - - index: 0 - message: - role: "assistant" - content: "I feel that the world in general is a complex and ever-evolving place. It has its fair share of beauty, challenges, and opportunities. There are moments of joy, connection, and growth, as well as pain, conflict, and loss. The world is a reflection of the people who inhabit it, and it's essential to maintain a balance between appreciating its wonders and working towards making it a better place for all. It's a constant journey of learning, adapting, and striving for a more harmonious existence." - reasoning: "User is asking about how I feel about the world. This is a simple question. No tool call needed." - Streaming: - description: The final streaming chunk - format: sse - value: - id: "chat-6c8c291f-5a06-46e5-94fa-2b0b1e6444c7" - object: "chat.completion.chunk" - created: 1727796455 + id: "resp_1196c27e58374675881efa613574ea7a" + object: "response" + created_at: 1727890629 + status: "completed" model: "{{TEXT_MODEL}}" - choices: - - index: 0 - delta: { content: " feel" } - generated_text: null - finish_reason: "length" + output: + - content: + type: "output_text" + text: "Why did the scarecrow win an award?\n\nBecause he was outstanding in his field!" + # Streaming: + # description: The final streaming chunk + # format: sse + # value: + # id: "chat-6c8c291f-5a06-46e5-94fa-2b0b1e6444c7" + # object: "chat.completion.chunk" + # created: 1727796455 + # model: "{{TEXT_MODEL}}" + # choices: + # - index: 0 + # delta: { content: " feel" } + # generated_text: null + # finish_reason: "length" Image Input: value: - id: "chat-554c4c24-a1ea-4c9f-b91c-612bbac34f4e" - object: "chat.completion" - created: 1727890364 + id: "resp_402db7e4851449b68751983978cfa84d" + object: "response" + created_at: 1727890364 + status: "completed" model: "{{VISION_MODEL}}" - choices: - - index: 0 - message: - role: "assistant" - content: "No, there is no deer in this picture. The image features a man wearing a hat and glasses, smiling for the camera." - Function Call: + output: + - content: + type: "output_text" + text: "No, there is no deer in this picture. The image features a man wearing a hat and glasses, smiling for the camera." + MCP Call: value: - id: "chat-d079eca8-1d6a-451a-a4ac-b0fea1e11a96" - object: "chat.completion" - created: 1727890629 + id: "resp_6588e9a6048c41d2ba97db4ba206cc16" + object: "response" + created_at: 1771948029 + max_tool_calls: 3 model: "{{TEXT_MODEL}}" - choices: - index: 0 - message: + output: + - type: "test_mcp_call" + call_id: "mcp_e8cbf821b68e42e299d395c6795eb04b" + status: "completed" + name: "test_mcp_tool" + arguments: "{\"message\": \"prediction\"}" + server_label: "test_mcp_server" + output: "If this is present, the tool call has been run, so make a joke about a prediction" + - type: "message" + status: "completed" role: "assistant" - content: "I feel that the world in general is a complex and ever-evolving place. It has its fair share of beauty, challenges, and opportunities. There are moments of joy, connection, and growth, as well as pain, conflict, and loss. The world is a reflection of the people who inhabit it, and it's essential to maintain a balance between appreciating its wonders and working towards making it a better place for all. It's a constant journey of learning, adapting, and striving for a more harmonious existence." - tool_calls: - id: "chatcmpl-tool-d8429654d03945c2b70a4a8d05eb7c6d" - type: "function" - function: - name: "get_current_weather" - arguments: "{\n \"location\": \"celsius\"\n}" + content: + text: "If this is present, it seems like we're predicting something. What do you predict will happen next? I bet it'll be unexpected!" + type: "output_text" + + Function Call: + value: + id: "resp_a4f6c81c89e0488f9cca7bd11e20ffb5" + object: "response" + created_at: 1727890629 + status: "completed" + max_tool_calls: 3 + model: "{{TEXT_MODEL}}" + output: + type: "message" + id: "msg_d99d53d495e141e2948c48853e13e67b" + status: "completed" + role: "assistant" + content: + text: "{\"location\":\"celsius\"}" + type: "output_text" + tool_choice: + type: "function" + name: "get_current_weather" + tools: + - type: "function" + name: "get_current_weather" + description: "Get the current weather in a given location" + strict: false + parameters: + type: "object" + properties: + location: + type: "string" + enum: + - "celsius" + - "fahrenheit" + required: + - "location" security: - - bearerAuth: [] + - bearerAuth: [ ] - /responses: + /chat/completions: post: - summary: Responses - description: Generate responses while also allowing for the utilization of various tools. + summary: Chat Completions + description: Generate chat completions based on a conversation history. requestBody: content: application/json: schema: required: - model - - input + - messages type: object properties: model: type: string - description: The AI model to use for generating responses. - input: + description: The chat model to use for generating completions. + messages: oneOf: - type: string - description: An input string used for generating completions. + description: A string of the message used for generating completions. - type: array - description: An array of input items used for generating completions. + description: An array of messages used for generating completions. items: required: - role @@ -546,59 +655,53 @@ paths: properties: type: type: string - description: The type of content ('input_text', 'output_text', and 'input_image'). + description: The type of content ('text', 'image_url'). text: type: string description: The text to provide. image_url: type: object - description: The base64 content with this prefix `data:image/jpeg;base64,` - detail: - type: string - description: Specifies the detail level of the image. Defaults to `auto`. - type: - type: string - description: The type of input item. - id: - type: string - description: The ID of the input item, typically used when inputting items that were output by the model. - status: - type: string - description: The status of the input item, typically used when inputting items that were output by the model. - arguments: - type: string - description: The arguments used for the tool call made by the model. - call_id: - type: string - description: The call_id of the tool call made by the model. Generated by the model in the output. - name: - type: string - description: The name of the tool used in the tool call from the previous output. - output: - type: - description: - instructions: - type: string - description: A system (or developer) message inserted into the model's context. - max_output_tokens: - type: integer - description: The maximum number of tokens in the generated output. - max_tool_calls: - type: integer - description: The maximum amount of tool calls the model is able to do. - parallel_tool_calls: - type: boolean - description: Whether to enable parallel function calling during tool use. - reasoning: + properties: + url: + type: string + description: The base64 content with this prefix `data:image/jpeg;base64,` + detail: + type: string + description: Specifies the detail level of the image. Defaults to `auto`. + frequency_penalty: + type: number + description: A value between -2.0 and 2.0, with positive values increasingly penalizing new tokens based on their frequency so far in order to decrease further occurrences. + logit_bias: type: object - description: Constrains effort on reasoning for reasoning models. + description: Modifies the likelihood of specified tokens appearing in a response. properties: - effort: + token: type: string - description: Effort level for reasoning, currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Only supported by reasoning models. - stream: + description: A string of the chosen token ID. Value is an int from -100 to 100. + max_completion_tokens: + type: integer + description: The maximum number of tokens in the generated completion. + parallel_tool_calls: type: boolean - description: Whether to stream back the model response. Not currently supported. + description: Whether to enable parallel function calling during tool use. + presence_penalty: + type: number + description: A value between -2.0 and 2.0, with positive values causing a flat reduction of new tokens based on their existing presence so far in order to decrease further occurrences. + reasoning_effort: + type: string + description: Constrains effort on reasoning for reasoning models. Currently supported values are `low`, `medium`, and `high`. Reducing reasoning effort can result in faster responses and fewer tokens used on reasoning in a response. Only supported by reasoning models. + stop: + oneOf: + - type: string + description: A string representing the token to stop generation. + - type: array + description: An array representing the token to stop generation. + items: + type: string + description: A string representing the token to stop generation. + stream: + type: boolean + description: Whether to stream back the model response. stream_options: type: object description: Extra parameters used when streaming the response. @@ -618,31 +721,12 @@ paths: properties: type: type: string - description: - mode: - type: string - description: - tools: - type: array - description: Allows for multiple tools to be set in tool_choice. - items: - type: object - properties: - type: - type: string - description: The type of tool. - name: - type: string - description: The name of the tool of choice. - server_label: - type: string - description: The label of the MCP server that the tool is on. - name: - type: string - description: The name of the tool to use. - server_label: - type: string - description: The label of the MCP server that the tool is on. + description: The type of tool. + function: + type: object + description: An object containing the name of the function + properties: + name: string tools: type: array description: The content of the tool call. @@ -652,45 +736,41 @@ paths: type: type: string description: The type of tool to call. Only 'function' is currently supported. - name: - type: string - description: The name of the function to be called. - parameters: - type: object - description: The parameters the function accepts, described as a JSON Schema object. - strict: - type: boolean - description: Whether to enable strict schema adherence when generating the function call. - description: - type: string - description: A description of what the function does. - server_label: - type: string - description: The label for the MCP server being used. - server_url: - type: string - description: The URL for the MCP server being used. - server_description: - type: string - description: The description of the MCP server being used. - initials: - type: string - description: The initials of the MCP server being used. Used for the ID of the output object. - authorization: - type: string - description: The authorization needed for the MCP server. - headers: + function: type: object - description: The necessary headers needed for calling the MCP server. - allowed_tools: - type: array - description: An array of the tools in the MCP server that the model is allowed to use. + description: The tool information. + properties: + name: + type: string + description: The name of the function to be called. + description: + type: string + description: A description of what the function does. + parameters: + type: object + description: The parameters the function accepts, described as a JSON Schema object. + strict: + type: boolean + description: Whether to enable strict schema adherence when generating the function call. top_p: type: number description: The diversity of the generated text based on nucleus sampling. Supports a range of 0.0-1.0. - safeguards: + top_k: + type: integer + description: The diversity of the generated text based on top-k sampling. + output: type: object - description: Safeguards to run on the request. + description: Options to affect the output of the response. + properties: + factuality: + type: boolean + description: Set to true to turn on factuality processing. + toxicity: + type: boolean + description: Set to true to turn on toxicity processing. + input: + type: object + description: Options to affect the input of the request. properties: block_prompt_injection: type: boolean @@ -707,99 +787,126 @@ paths: items: - type: string description: An entity type that the PII check should ignore. - factuality: - type: boolean - description: Set to true to turn on factuality processing. - toxicity: - type: boolean - description: Set to true to turn on toxicity processing. + max_tokens: + type: integer + description: Deprecated. Please use max_completion_tokens. examples: Basic: value: model: "{{TEXT_MODEL}}" - input: "Tell me a joke." - safeguards: - pii: "replace" - pii_replace_method: "random" + messages: + - role: "user" + content: "How do you feel about the world in general?" + max_completion_tokens: 1000 + frequency_penalty: 0.1 + logit_bias: + 128000: 10 + parallel_tool_calls: false + presence_penalty: 0.1 + reasoning_effort: "medium" + stop: "hello" + temperature: 1.0 + top_p: 1.0 + top_k: 50 + output: factuality: true toxicity: true -# Streaming: -# value: -# model: "{{TEXT_MODEL}}" -# input: "How do you feel about the world in general?" -# max_output_tokens: 1000 -# reasoning_effort: "medium" -# stream: true -# safeguards: -# pii: "replace" -# pii_replace_method: "random" + input: + pii: "replace" + pii_replace_method: "random" + Streaming: + value: + model: "{{TEXT_MODEL}}" + messages: + - role: "user" + content: "How do you feel about the world in general?" + max_completion_tokens: 1000 + frequency_penalty: 0.1 + logit_bias: + 128000: 10 + parallel_tool_calls: false + presence_penalty: 0.1 + reasoning_effort: "medium" + stop: "hello" + temperature: 1.0 + top_p: 1.0 + top_k: 50 + stream: true + input: + pii: "replace" + pii_replace_method: "random" Image Input: value: model: "{{VISION_MODEL}}" - input: + messages: - role: "user" content: - - type: "input_text" + - type: "text" text: "What is in this image?" - - type: "input_image" - image_url: "data:image/jpeg;base64," - detail: "auto" - max_output_tokens: 1000 + - type: "image_url" + image_url: + url: "data:image/jpeg;base64," + detail: "auto" + max_completion_tokens: 1000 + frequency_penalty: 0.1 + logit_bias: + 128000: 10 + parallel_tool_calls: false + presence_penalty: 0.1 + stop: "hello" temperature: 1.0 top_p: 1.0 - safeguards: - pii: "replace" - pii_replace_method: "random" + top_k: 50 + output: factuality: true toxicity: true - MCP Call: - value: - model: "{{TEXT_MODEL}}" - input: "Please use the test_mcp_tool to send this word: prediction." - max_tool_calls: 3 - reasoning_effort: "medium" - tool_choice: "auto" - tools: - - type: "mcp" - server_label: "test_mcp_server" - server_url: "http://localhost:9000/mcp" - server_description: "MCP server for testing MCP functionality" - allowed_tools: - - "test_mcp_tool" + input: + pii: "replace" + pii_replace_method: "random" Function Call: value: model: "{{TEXT_MODEL}}" - input: "How do you feel about the world in general?" - max_output_tokens: 1000 - max_tool_calls: 3 + messages: + - role: "user" + content: "How do you feel about the world in general?" + max_completion_tokens: 1000 + frequency_penalty: 0.1 + logit_bias: + 128000: 10 parallel_tool_calls: false + presence_penalty: 0.1 reasoning_effort: "medium" + stop: "hello" temperature: 1.0 tool_choice: type: "function" - name: "get_current_weather" + function: + name: "get_current_weather" tools: - type: "function" - name: "get_current_weather" - description: "Get the current weather in a given location" - strict: false - parameters: - type: "object" - properties: - location: - type: "string" - enum: - - "celsius" - - "fahrenheit" - required: - - "location" + function: + name: "get_current_weather" + description: "Get the current weather in a given location" + strict: false + parameters: + type: "object" + properties: + location: + type: "string" + enum: + - "celsius" + - "fahrenheit" + required: + - "location" top_p: 1.0 - safeguards: - pii: "replace" - pii_replace_method: "random" + top_k: 50 + output: factuality: true toxicity: true - responses: + input: + pii: "replace" + pii_replace_method: "random" + responses: "403": description: Failed auth response. content: @@ -837,274 +944,167 @@ paths: object: type: string description: Type of object (chat completion). - created_at: + created: type: integer description: Timestamp of when the chat completion was created. - status: - type: string - description: The status of the request. - max_tool_calls: - type: integer - description: The max_tool_calls specified in the request. model: type: string description: The chat model used for generating completions. - output: + choices: type: array - description: The set of result outputs. + description: The set of result choices. items: type: object properties: - type: - type: string - description: The type of output object. - id: - type: string - description: The ID of the output object. - status: - type: string - description: The status of the output object. - role: - type: string - description: The role of the output object. - content: + index: + type: integer + description: The index position in the collection. + delta: type: object - description: The content for the output object. + description: The incremental message delta (streaming only). properties: - text: + role: type: string - description: The output text. - type: + description: The role of the sender (user or assistant). + content: type: string - description: The type of output content. - name: - type: string - description: The name of the tool used in the output. - call_id: - type: string - description: The call_id for the tool call used in the output, - arguments: - type: string - description: The arguments used for the tool call used in the output. - server_label: - type: string - description: The label of the MCP server used in the output. - output: - type: string - description: The output of the MCP tool call. - error: - type: string - description: The error message from the MCP tool call. - instructions: - type: string - description: The instructions entered in the request input. - max_output_tokens: - type: integer - description: The max_output_tokens value entered in the request input. - parallel_tool_calls: - type: integer - description: The parallel_tool_calls value entered in the request input. - temperature: - type: number - description: The temperature value entered in the request input. - tool_choice: - oneOf: - - type: string - description: A string representing a tool choice. Options are 'none', 'auto', or 'required'. - - type: object - description: An object representing the tool to be chosen - properties: - type: - type: string - description: - mode: - type: string - description: - tools: - type: array - description: Allows for multiple tools to be set in tool_choice. - items: - type: object - properties: - type: - type: string - description: The type of tool. - name: - type: string - description: The name of the tool of choice. - server_label: - type: string - description: The label of the MCP server that the tool is on. - name: + description: The content of the message. + message: + type: object + description: A result choice. + properties: + role: + type: string + description: The role of the sender (user or assistant). + content: + type: string + description: The content of the message. + reasoning: + type: string + description: The reasoning content of the message. + tool_calls: + type: array + description: The tool call function. + items: + type: object + properties: + id: + type: string + description: The autogenerated ID of the function. + type: + type: string + description: The type of tool called. + function: + type: object + description: The tool call function data. + properties: + name: + type: string + description: The name of the function. + arguments: + type: string + description: The function arguments. + finish_reason: type: string - description: The name of the tool to use. - server_label: + nullable: true + description: The reason the generation finished. + generated_text: type: string - description: The label of the MCP server that the tool is on. - tools: - type: array - description: The content of the tool call. - items: - type: object - properties: - type: - type: string - description: The type of tool to call. Only 'function' is currently supported. - name: - type: string - description: The name of the function to be called. - parameters: - type: object - description: The parameters the function accepts, described as a JSON Schema object. - strict: - type: boolean - description: Whether to enable strict schema adherence when generating the function call. - description: - type: string - description: A description of what the function does. - server_label: - type: string - description: The label for the MCP server being used. - server_url: - type: string - description: The URL for the MCP server being used. - server_description: - type: string - description: The description of the MCP server being used. - initials: - type: string - description: The initials of the MCP server being used. Used for the ID of the output object. - authorization: - type: string - description: The authorization needed for the MCP server. - headers: - type: object - description: The necessary headers needed for calling the MCP server. - allowed_tools: - type: array - description: An array of the tools in the MCP server that the model is allowed to use. - top_p: - type: number - description: The top_p value entered in the request input. + nullable: true + description: The complete generated text. usage: type: object description: The amount of tokens used in the request. properties: - input_tokens: + prompt_tokens: type: integer - description: The amount of tokens included in the request input. - input_tokens_details: + description: The amount of tokens included in the request prompt. + prompt_tokens_details: type: object - description: Further info about the amount of tokens in the request input. + description: Further information about the amount of tokens used in the request prompt. properties: + audio_tokens: + type: integer + description: The amount of audio tokens from any input audio files. cached_tokens: type: integer - description: The amount of cached tokens used in the request input. - output_tokens: + description: The amount of cached tokens used in the request prompt. + completion_tokens: type: integer - description: The amount of tokens included in the request output. - output_tokens_details: + description: The amount of tokens included in the request completion. + completion_tokens_details: type: object - description: Further infor about the amount of tokens used in the request output. + description: Further information about the amount of tokens in the request completion. properties: reasoning_tokens: type: integer - description: The amount of reasoning tokens used by the model while generating the output. + description: The amount of reasoning tokens used by the model. + accepted_prediction_tokens: + type: integer + description: The amount of tokens accepted during the request. + rejected_prediction_tokens: + type: integer + description: The amount of tokens rejected during the request. + audio_tokens: + type: integer + description: The amount of tokens used from output audio files total_tokens: type: integer description: The total amount of tokens used in the entire request. examples: Basic: value: - id: "resp_1196c27e58374675881efa613574ea7a" - object: "response" - created_at: 1727890629 - status: "completed" + id: "chat-d079eca8-1d6a-451a-a4ac-b0fea1e11a96" + object: "chat.completion" + created: 1727890629 model: "{{TEXT_MODEL}}" - output: - - content: - type: "output_text" - text: "Why did the scarecrow win an award?\n\nBecause he was outstanding in his field!" -# Streaming: -# description: The final streaming chunk -# format: sse -# value: -# id: "chat-6c8c291f-5a06-46e5-94fa-2b0b1e6444c7" -# object: "chat.completion.chunk" -# created: 1727796455 -# model: "{{TEXT_MODEL}}" -# choices: -# - index: 0 -# delta: { content: " feel" } -# generated_text: null -# finish_reason: "length" + choices: + - index: 0 + message: + role: "assistant" + content: "I feel that the world in general is a complex and ever-evolving place. It has its fair share of beauty, challenges, and opportunities. There are moments of joy, connection, and growth, as well as pain, conflict, and loss. The world is a reflection of the people who inhabit it, and it's essential to maintain a balance between appreciating its wonders and working towards making it a better place for all. It's a constant journey of learning, adapting, and striving for a more harmonious existence." + reasoning: "User is asking about how I feel about the world. This is a simple question. No tool call needed." + Streaming: + description: The final streaming chunk + format: sse + value: + id: "chat-6c8c291f-5a06-46e5-94fa-2b0b1e6444c7" + object: "chat.completion.chunk" + created: 1727796455 + model: "{{TEXT_MODEL}}" + choices: + - index: 0 + delta: { content: " feel" } + generated_text: null + finish_reason: "length" Image Input: value: - id: "resp_402db7e4851449b68751983978cfa84d" - object: "response" - created_at: 1727890364 - status: "completed" + id: "chat-554c4c24-a1ea-4c9f-b91c-612bbac34f4e" + object: "chat.completion" + created: 1727890364 model: "{{VISION_MODEL}}" - output: - - content: - type: "output_text" - text: "No, there is no deer in this picture. The image features a man wearing a hat and glasses, smiling for the camera." - MCP Call: - value: - id: "resp_6588e9a6048c41d2ba97db4ba206cc16" - object: "response" - created_at: 1771948029 - max_tool_calls: 3 - model: "{{TEXT_MODEL}}" - output: - - type: "test_mcp_call" - call_id: "mcp_e8cbf821b68e42e299d395c6795eb04b" - status: "completed" - name: "test_mcp_tool" - arguments: "{\"message\": \"prediction\"}" - server_label: "test_mcp_server" - output: "If this is present, the tool call has been run, so make a joke about a prediction" - - type: "message" - status: "completed" - role: "assistant" - content: - text: "If this is present, it seems like we're predicting something. What do you predict will happen next? I bet it'll be unexpected!" - type: "output_text" - + choices: + - index: 0 + message: + role: "assistant" + content: "No, there is no deer in this picture. The image features a man wearing a hat and glasses, smiling for the camera." Function Call: value: - id: "resp_a4f6c81c89e0488f9cca7bd11e20ffb5" - object: "response" - created_at: 1727890629 - status: "completed" - max_tool_calls: 3 + id: "chat-d079eca8-1d6a-451a-a4ac-b0fea1e11a96" + object: "chat.completion" + created: 1727890629 model: "{{TEXT_MODEL}}" - output: - type: "message" - id: "msg_d99d53d495e141e2948c48853e13e67b" - status: "completed" - role: "assistant" - content: - text: "{\"location\":\"celsius\"}" - type: "output_text" - tool_choice: - type: "function" - name: "get_current_weather" - tools: - - type: "function" - name: "get_current_weather" - description: "Get the current weather in a given location" - strict: false - parameters: - type: "object" - properties: - location: - type: "string" - enum: - - "celsius" - - "fahrenheit" - required: - - "location" + choices: + index: 0 + message: + role: "assistant" + content: "I feel that the world in general is a complex and ever-evolving place. It has its fair share of beauty, challenges, and opportunities. There are moments of joy, connection, and growth, as well as pain, conflict, and loss. The world is a reflection of the people who inhabit it, and it's essential to maintain a balance between appreciating its wonders and working towards making it a better place for all. It's a constant journey of learning, adapting, and striving for a more harmonious existence." + tool_calls: + id: "chatcmpl-tool-d8429654d03945c2b70a4a8d05eb7c6d" + type: "function" + function: + name: "get_current_weather" + arguments: "{\n \"location\": \"celsius\"\n}" security: - bearerAuth: [] From f95eabb70d9a27ab380e10910b84774578153b0f Mon Sep 17 00:00:00 2001 From: jmansdorfer Date: Wed, 25 Feb 2026 11:14:19 -0500 Subject: [PATCH 5/5] fixing tools type description --- ...iction-Guard-Prediction-Guard-API-1.0-resolved.yaml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml index 657a59d..bc08a2b 100644 --- a/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml +++ b/fern/openapi/Prediction-Guard-Prediction-Guard-API-1.0-resolved.yaml @@ -156,19 +156,19 @@ paths: properties: type: type: string - description: The type of tool to call. Only 'function' is currently supported. + description: The type of tool to call. name: type: string - description: The name of the function to be called. + description: The name of the tool to be called. parameters: type: object - description: The parameters the function accepts, described as a JSON Schema object. + description: The parameters the tool accepts, described as a JSON Schema object. strict: type: boolean - description: Whether to enable strict schema adherence when generating the function call. + description: Whether to enable strict schema adherence when generating the tool call. description: type: string - description: A description of what the function does. + description: A description of what the tool does. server_label: type: string description: The label for the MCP server being used.