1103 lines
32 KiB
C++
1103 lines
32 KiB
C++
#pragma once
|
|
|
|
// Fixtures taken verbatim from the OpenAI OpenAPI document (x-oaiMeta examples),
|
|
// openai/openai-openapi @ 8243cc8fa6f0. Requests are the curl -d bodies, responses
|
|
// the documented example responses (em dashes replaced by hyphens). Not scripted replies.
|
|
|
|
namespace molo::openai::core::fixtures {
|
|
|
|
inline constexpr const char* k_resp_text_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"input": "Tell me a three sentence bedtime story about a unicorn."
|
|
})OAIFIX";
|
|
inline constexpr const char* k_resp_text_response = R"OAIFIX({
|
|
"id": "resp_67ccd2bed1ec8190b14f964abc0542670bb6a6b452d3795b",
|
|
"object": "response",
|
|
"access_programs": null,
|
|
"created_at": 1741476542,
|
|
"status": "completed",
|
|
"completed_at": 1741476543,
|
|
"error": null,
|
|
"incomplete_details": null,
|
|
"instructions": null,
|
|
"max_output_tokens": null,
|
|
"model": "gpt-6-astra",
|
|
"output": [
|
|
{
|
|
"type": "message",
|
|
"id": "msg_67ccd2bf17f0819081ff3bb2cf6508e60bb6a6b452d3795b",
|
|
"status": "completed",
|
|
"role": "assistant",
|
|
"content": [
|
|
{
|
|
"type": "output_text",
|
|
"text": "In a peaceful grove beneath a silver moon, a unicorn named Lumina discovered a hidden pool that reflected the stars. As she dipped her horn into the water, the pool began to shimmer, revealing a pathway to a magical realm of endless night skies. Filled with wonder, Lumina whispered a wish for all who dream to find their own hidden magic, and as she glanced back, her hoofprints sparkled like stardust.",
|
|
"annotations": [],
|
|
"logprobs": []
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"parallel_tool_calls": true,
|
|
"previous_response_id": null,
|
|
"reasoning": {
|
|
"effort": null,
|
|
"summary": null
|
|
},
|
|
"store": true,
|
|
"temperature": 1.0,
|
|
"text": {
|
|
"format": {
|
|
"type": "text"
|
|
}
|
|
},
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 1.0,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 36,
|
|
"input_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"cache_write_tokens": 0
|
|
},
|
|
"output_tokens": 87,
|
|
"output_tokens_details": {
|
|
"reasoning_tokens": 0
|
|
},
|
|
"total_tokens": 123
|
|
},
|
|
"user": null,
|
|
"metadata": {}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_resp_func_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"input": "What is the weather like in Boston today?",
|
|
"tools": [
|
|
{
|
|
"type": "function",
|
|
"name": "get_current_weather",
|
|
"description": "Get the current weather in a given location",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"location": {
|
|
"type": "string",
|
|
"description": "The city and state, e.g. San Francisco, CA"
|
|
},
|
|
"unit": {
|
|
"type": "string",
|
|
"enum": ["celsius", "fahrenheit"]
|
|
}
|
|
},
|
|
"required": ["location", "unit"]
|
|
}
|
|
}
|
|
],
|
|
"tool_choice": "auto"
|
|
})OAIFIX";
|
|
inline constexpr const char* k_resp_func_response = R"OAIFIX({
|
|
"id": "resp_67ca09c5efe0819096d0511c92b8c890096610f474011cc0",
|
|
"object": "response",
|
|
"access_programs": null,
|
|
"created_at": 1741294021,
|
|
"status": "completed",
|
|
"completed_at": 1741294022,
|
|
"error": null,
|
|
"incomplete_details": null,
|
|
"instructions": null,
|
|
"max_output_tokens": null,
|
|
"model": "gpt-6-astra",
|
|
"output": [
|
|
{
|
|
"type": "function_call",
|
|
"id": "fc_67ca09c6bedc8190a7abfec07b1a1332096610f474011cc0",
|
|
"call_id": "call_unLAR8MvFNptuiZK6K6HCy5k",
|
|
"name": "get_current_weather",
|
|
"arguments": "{\"location\":\"Boston, MA\",\"unit\":\"celsius\"}",
|
|
"status": "completed"
|
|
}
|
|
],
|
|
"parallel_tool_calls": true,
|
|
"previous_response_id": null,
|
|
"reasoning": {
|
|
"effort": null,
|
|
"summary": null
|
|
},
|
|
"store": true,
|
|
"temperature": 1.0,
|
|
"text": {
|
|
"format": {
|
|
"type": "text"
|
|
}
|
|
},
|
|
"tool_choice": "auto",
|
|
"tools": [
|
|
{
|
|
"type": "function",
|
|
"description": "Get the current weather in a given location",
|
|
"name": "get_current_weather",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"location": {
|
|
"type": "string",
|
|
"description": "The city and state, e.g. San Francisco, CA"
|
|
},
|
|
"unit": {
|
|
"type": "string",
|
|
"enum": [
|
|
"celsius",
|
|
"fahrenheit"
|
|
]
|
|
}
|
|
},
|
|
"required": [
|
|
"location",
|
|
"unit"
|
|
]
|
|
},
|
|
"strict": true
|
|
}
|
|
],
|
|
"top_p": 1.0,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 291,
|
|
"output_tokens": 23,
|
|
"output_tokens_details": {
|
|
"reasoning_tokens": 0
|
|
},
|
|
"total_tokens": 314,
|
|
"input_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"cache_write_tokens": 0
|
|
}
|
|
},
|
|
"user": null,
|
|
"metadata": {}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_resp_stream_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"instructions": "You are a helpful assistant.",
|
|
"input": "Hello!",
|
|
"stream": true
|
|
})OAIFIX";
|
|
inline constexpr const char* k_resp_stream_response = R"OAIFIX(event: response.created
|
|
data: {"type":"response.created","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":0}
|
|
|
|
event: response.in_progress
|
|
data: {"type":"response.in_progress","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"in_progress","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":null,"user":null,"metadata":{}},"sequence_number":1}
|
|
|
|
event: response.output_item.added
|
|
data: {"type":"response.output_item.added","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"in_progress","role":"assistant","content":[]},"sequence_number":2}
|
|
|
|
event: response.content_part.added
|
|
data: {"type":"response.content_part.added","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"","annotations":[],"logprobs":[]},"sequence_number":3}
|
|
|
|
event: response.output_text.delta
|
|
data: {"type":"response.output_text.delta","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"delta":"Hi","sequence_number":4,"logprobs":[]}
|
|
|
|
: Intermediate response events omitted.
|
|
|
|
event: response.output_text.done
|
|
data: {"type":"response.output_text.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"text":"Hi there! How can I assist you today?","sequence_number":10,"logprobs":[]}
|
|
|
|
event: response.content_part.done
|
|
data: {"type":"response.content_part.done","item_id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","output_index":0,"content_index":0,"part":{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[],"logprobs":[]},"sequence_number":11}
|
|
|
|
event: response.output_item.done
|
|
data: {"type":"response.output_item.done","output_index":0,"item":{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[],"logprobs":[]}]},"sequence_number":12}
|
|
|
|
event: response.completed
|
|
data: {"type":"response.completed","response":{"id":"resp_67c9fdcecf488190bdd9a0409de3a1ec07b8b0ad4e5eb654","object":"response","access_programs":null,"created_at":1741290958,"status":"completed","error":null,"incomplete_details":null,"instructions":"You are a helpful assistant.","max_output_tokens":null,"model":"gpt-6-astra","output":[{"id":"msg_67c9fdcf37fc8190ba82116e33fb28c507b8b0ad4e5eb654","type":"message","status":"completed","role":"assistant","content":[{"type":"output_text","text":"Hi there! How can I assist you today?","annotations":[],"logprobs":[]}]}],"parallel_tool_calls":true,"previous_response_id":null,"reasoning":{"effort":null,"summary":null},"store":true,"temperature":1.0,"text":{"format":{"type":"text"}},"tool_choice":"auto","tools":[],"top_p":1.0,"truncation":"disabled","usage":{"input_tokens":37,"output_tokens":11,"output_tokens_details":{"reasoning_tokens":0},"total_tokens":48,"input_tokens_details":{"cached_tokens":0,"cache_write_tokens":0}},"user":null,"metadata":{}},"sequence_number":13}
|
|
|
|
)OAIFIX";
|
|
inline constexpr const char* k_resp_reason_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"input": "How much wood would a woodchuck chuck?",
|
|
"reasoning": {
|
|
"effort": "high"
|
|
}
|
|
})OAIFIX";
|
|
inline constexpr const char* k_resp_reason_response = R"OAIFIX({
|
|
"id": "resp_67ccd7eca01881908ff0b5146584e408072912b2993db808",
|
|
"object": "response",
|
|
"access_programs": null,
|
|
"created_at": 1741477868,
|
|
"status": "completed",
|
|
"completed_at": 1741477869,
|
|
"error": null,
|
|
"incomplete_details": null,
|
|
"instructions": null,
|
|
"max_output_tokens": null,
|
|
"model": "gpt-6-astra",
|
|
"output": [
|
|
{
|
|
"type": "message",
|
|
"id": "msg_67ccd7f7b5848190a6f3e95d809f6b44072912b2993db808",
|
|
"status": "completed",
|
|
"role": "assistant",
|
|
"content": [
|
|
{
|
|
"type": "output_text",
|
|
"text": "The classic tongue twister...",
|
|
"annotations": [],
|
|
"logprobs": []
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"parallel_tool_calls": true,
|
|
"previous_response_id": null,
|
|
"reasoning": {
|
|
"effort": "high",
|
|
"summary": null
|
|
},
|
|
"store": true,
|
|
"temperature": 1.0,
|
|
"text": {
|
|
"format": {
|
|
"type": "text"
|
|
}
|
|
},
|
|
"tool_choice": "auto",
|
|
"tools": [],
|
|
"top_p": 1.0,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 81,
|
|
"input_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"cache_write_tokens": 0
|
|
},
|
|
"output_tokens": 1035,
|
|
"output_tokens_details": {
|
|
"reasoning_tokens": 832
|
|
},
|
|
"total_tokens": 1116
|
|
},
|
|
"user": null,
|
|
"metadata": {}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_resp_websearch_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"tools": [{ "type": "web_search_preview" }],
|
|
"input": "What was a positive news story from today?"
|
|
})OAIFIX";
|
|
inline constexpr const char* k_resp_websearch_response = R"OAIFIX({
|
|
"id": "resp_67ccf18ef5fc8190b16dbee19bc54e5f087bb177ab789d5c",
|
|
"object": "response",
|
|
"access_programs": null,
|
|
"created_at": 1741484430,
|
|
"status": "completed",
|
|
"completed_at": 1741484431,
|
|
"error": null,
|
|
"incomplete_details": null,
|
|
"instructions": null,
|
|
"max_output_tokens": null,
|
|
"model": "gpt-6-astra",
|
|
"output": [
|
|
{
|
|
"type": "web_search_call",
|
|
"id": "ws_67ccf18f64008190a39b619f4c8455ef087bb177ab789d5c",
|
|
"status": "completed"
|
|
},
|
|
{
|
|
"type": "message",
|
|
"id": "msg_67ccf190ca3881909d433c50b1f6357e087bb177ab789d5c",
|
|
"status": "completed",
|
|
"role": "assistant",
|
|
"content": [
|
|
{
|
|
"type": "output_text",
|
|
"text": "As of today, March 9, 2025, one notable positive news story...",
|
|
"annotations": [
|
|
{
|
|
"type": "url_citation",
|
|
"start_index": 442,
|
|
"end_index": 557,
|
|
"url": "https://.../?utm_source=chatgpt.com",
|
|
"title": "..."
|
|
},
|
|
{
|
|
"type": "url_citation",
|
|
"start_index": 962,
|
|
"end_index": 1077,
|
|
"url": "https://.../?utm_source=chatgpt.com",
|
|
"title": "..."
|
|
},
|
|
{
|
|
"type": "url_citation",
|
|
"start_index": 1336,
|
|
"end_index": 1451,
|
|
"url": "https://.../?utm_source=chatgpt.com",
|
|
"title": "..."
|
|
}
|
|
],
|
|
"logprobs": []
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"parallel_tool_calls": true,
|
|
"previous_response_id": null,
|
|
"reasoning": {
|
|
"effort": null,
|
|
"summary": null
|
|
},
|
|
"store": true,
|
|
"temperature": 1.0,
|
|
"text": {
|
|
"format": {
|
|
"type": "text"
|
|
}
|
|
},
|
|
"tool_choice": "auto",
|
|
"tools": [
|
|
{
|
|
"type": "web_search_preview",
|
|
"domains": [],
|
|
"search_context_size": "medium",
|
|
"user_location": {
|
|
"type": "approximate",
|
|
"city": null,
|
|
"country": "US",
|
|
"region": null,
|
|
"timezone": null
|
|
}
|
|
}
|
|
],
|
|
"top_p": 1.0,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 328,
|
|
"input_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"cache_write_tokens": 0
|
|
},
|
|
"output_tokens": 356,
|
|
"output_tokens_details": {
|
|
"reasoning_tokens": 0
|
|
},
|
|
"total_tokens": 684
|
|
},
|
|
"user": null,
|
|
"metadata": {}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_resp_filesearch_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"tools": [{
|
|
"type": "file_search",
|
|
"vector_store_ids": ["vs_1234567890"],
|
|
"max_num_results": 20
|
|
}],
|
|
"input": "What are the attributes of an ancient brown dragon?"
|
|
})OAIFIX";
|
|
inline constexpr const char* k_resp_filesearch_response = R"OAIFIX({
|
|
"id": "resp_67ccf4c55fc48190b71bd0463ad3306d09504fb6872380d7",
|
|
"object": "response",
|
|
"access_programs": null,
|
|
"created_at": 1741485253,
|
|
"status": "completed",
|
|
"completed_at": 1741485254,
|
|
"error": null,
|
|
"incomplete_details": null,
|
|
"instructions": null,
|
|
"max_output_tokens": null,
|
|
"model": "gpt-6-astra",
|
|
"output": [
|
|
{
|
|
"type": "file_search_call",
|
|
"id": "fs_67ccf4c63cd08190887ef6464ba5681609504fb6872380d7",
|
|
"status": "completed",
|
|
"queries": [
|
|
"attributes of an ancient brown dragon"
|
|
],
|
|
"results": null
|
|
},
|
|
{
|
|
"type": "message",
|
|
"id": "msg_67ccf4c93e5c81909d595b369351a9d309504fb6872380d7",
|
|
"status": "completed",
|
|
"role": "assistant",
|
|
"content": [
|
|
{
|
|
"type": "output_text",
|
|
"text": "The attributes of an ancient brown dragon include...",
|
|
"annotations": [
|
|
{
|
|
"type": "file_citation",
|
|
"index": 320,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 576,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 815,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 815,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 1030,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 1030,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 1156,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
},
|
|
{
|
|
"type": "file_citation",
|
|
"index": 1225,
|
|
"file_id": "file-4wDz5b167pAf72nx1h9eiN",
|
|
"filename": "dragons.pdf"
|
|
}
|
|
],
|
|
"logprobs": []
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"parallel_tool_calls": true,
|
|
"previous_response_id": null,
|
|
"reasoning": {
|
|
"effort": null,
|
|
"summary": null
|
|
},
|
|
"store": true,
|
|
"temperature": 1.0,
|
|
"text": {
|
|
"format": {
|
|
"type": "text"
|
|
}
|
|
},
|
|
"tool_choice": "auto",
|
|
"tools": [
|
|
{
|
|
"type": "file_search",
|
|
"filters": null,
|
|
"max_num_results": 20,
|
|
"ranking_options": {
|
|
"ranker": "auto",
|
|
"score_threshold": 0.0
|
|
},
|
|
"vector_store_ids": [
|
|
"vs_1234567890"
|
|
]
|
|
}
|
|
],
|
|
"top_p": 1.0,
|
|
"truncation": "disabled",
|
|
"usage": {
|
|
"input_tokens": 18307,
|
|
"input_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"cache_write_tokens": 0
|
|
},
|
|
"output_tokens": 348,
|
|
"output_tokens_details": {
|
|
"reasoning_tokens": 0
|
|
},
|
|
"total_tokens": 18655
|
|
},
|
|
"user": null,
|
|
"metadata": {}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_chat_default_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"messages": [
|
|
{
|
|
"role": "developer",
|
|
"content": "You are a helpful assistant."
|
|
},
|
|
{
|
|
"role": "user",
|
|
"content": "Hello!"
|
|
}
|
|
]
|
|
})OAIFIX";
|
|
inline constexpr const char* k_chat_default_response = R"OAIFIX({
|
|
"id": "chatcmpl-B9MBs8CjcvOU2jLn4n570S5qMJKcT",
|
|
"object": "chat.completion",
|
|
"created": 1741569952,
|
|
"model": "gpt-6-astra",
|
|
"choices": [
|
|
{
|
|
"index": 0,
|
|
"message": {
|
|
"role": "assistant",
|
|
"content": "Hello! How can I assist you today?",
|
|
"refusal": null,
|
|
"annotations": []
|
|
},
|
|
"logprobs": null,
|
|
"finish_reason": "stop"
|
|
}
|
|
],
|
|
"usage": {
|
|
"prompt_tokens": 19,
|
|
"completion_tokens": 10,
|
|
"total_tokens": 29,
|
|
"prompt_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"audio_tokens": 0
|
|
},
|
|
"completion_tokens_details": {
|
|
"reasoning_tokens": 0,
|
|
"audio_tokens": 0,
|
|
"accepted_prediction_tokens": 0,
|
|
"rejected_prediction_tokens": 0
|
|
}
|
|
},
|
|
"service_tier": "default"
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_chat_stream_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"messages": [
|
|
{
|
|
"role": "developer",
|
|
"content": "You are a helpful assistant."
|
|
},
|
|
{
|
|
"role": "user",
|
|
"content": "Hello!"
|
|
}
|
|
],
|
|
"stream": true
|
|
})OAIFIX";
|
|
inline constexpr const char* k_chat_stream_response = R"OAIFIX(data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"role":"assistant","content":""},"logprobs":null,"finish_reason":null}]}
|
|
|
|
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{"content":"Hello"},"logprobs":null,"finish_reason":null}]}
|
|
|
|
: Intermediate chat completion chunks omitted.
|
|
|
|
data: {"id":"chatcmpl-123","object":"chat.completion.chunk","created":1694268190,"model":"gpt-6-astra", "system_fingerprint": "fp_44709d6fcb", "choices":[{"index":0,"delta":{},"logprobs":null,"finish_reason":"stop"}]}
|
|
|
|
data: [DONE]
|
|
|
|
)OAIFIX";
|
|
inline constexpr const char* k_chat_func_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": "What is the weather like in Boston today?"
|
|
}
|
|
],
|
|
"tools": [
|
|
{
|
|
"type": "function",
|
|
"function": {
|
|
"name": "get_current_weather",
|
|
"description": "Get the current weather in a given location",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": {
|
|
"location": {
|
|
"type": "string",
|
|
"description": "The city and state, e.g. San Francisco, CA"
|
|
},
|
|
"unit": {
|
|
"type": "string",
|
|
"enum": ["celsius", "fahrenheit"]
|
|
}
|
|
},
|
|
"required": ["location"]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"tool_choice": "auto"
|
|
})OAIFIX";
|
|
inline constexpr const char* k_chat_func_response = R"OAIFIX({
|
|
"id": "chatcmpl-abc123",
|
|
"object": "chat.completion",
|
|
"created": 1699896916,
|
|
"model": "gpt-6-astra",
|
|
"choices": [
|
|
{
|
|
"index": 0,
|
|
"message": {
|
|
"role": "assistant",
|
|
"content": null,
|
|
"tool_calls": [
|
|
{
|
|
"id": "call_abc123",
|
|
"type": "function",
|
|
"function": {
|
|
"name": "get_current_weather",
|
|
"arguments": "{\n\"location\": \"Boston, MA\"\n}"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"logprobs": null,
|
|
"finish_reason": "tool_calls"
|
|
}
|
|
],
|
|
"usage": {
|
|
"prompt_tokens": 82,
|
|
"completion_tokens": 17,
|
|
"total_tokens": 99,
|
|
"completion_tokens_details": {
|
|
"reasoning_tokens": 0,
|
|
"accepted_prediction_tokens": 0,
|
|
"rejected_prediction_tokens": 0
|
|
}
|
|
}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_chat_image_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"messages": [
|
|
{
|
|
"role": "user",
|
|
"content": [
|
|
{
|
|
"type": "text",
|
|
"text": "What is in this image?"
|
|
},
|
|
{
|
|
"type": "image_url",
|
|
"image_url": {
|
|
"url": "https://upload.wikimedia.org/wikipedia/commons/thumb/d/dd/Gfp-wisconsin-madison-the-nature-boardwalk.jpg/2560px-Gfp-wisconsin-madison-the-nature-boardwalk.jpg"
|
|
}
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"max_tokens": 300
|
|
})OAIFIX";
|
|
inline constexpr const char* k_chat_image_response = R"OAIFIX({
|
|
"id": "chatcmpl-B9MHDbslfkBeAs8l4bebGdFOJ6PeG",
|
|
"object": "chat.completion",
|
|
"created": 1741570283,
|
|
"model": "gpt-6-astra",
|
|
"choices": [
|
|
{
|
|
"index": 0,
|
|
"message": {
|
|
"role": "assistant",
|
|
"content": "The image shows a wooden boardwalk path running through a lush green field or meadow. The sky is bright blue with some scattered clouds, giving the scene a serene and peaceful atmosphere. Trees and shrubs are visible in the background.",
|
|
"refusal": null,
|
|
"annotations": []
|
|
},
|
|
"logprobs": null,
|
|
"finish_reason": "stop"
|
|
}
|
|
],
|
|
"usage": {
|
|
"prompt_tokens": 1117,
|
|
"completion_tokens": 46,
|
|
"total_tokens": 1163,
|
|
"prompt_tokens_details": {
|
|
"cached_tokens": 0,
|
|
"audio_tokens": 0
|
|
},
|
|
"completion_tokens_details": {
|
|
"reasoning_tokens": 0,
|
|
"audio_tokens": 0,
|
|
"accepted_prediction_tokens": 0,
|
|
"rejected_prediction_tokens": 0
|
|
}
|
|
},
|
|
"service_tier": "default"
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_embed_request = R"OAIFIX({
|
|
"input": "Hello world",
|
|
"model": "text-embedding-3-small",
|
|
"encoding_format": "float",
|
|
"dimensions": 3
|
|
})OAIFIX";
|
|
inline constexpr const char* k_embed_response = R"OAIFIX({
|
|
"object": "list",
|
|
"data": [
|
|
{
|
|
"object": "embedding",
|
|
"embedding": [
|
|
0.26726124,
|
|
0.53452248,
|
|
0.80178373
|
|
],
|
|
"index": 0
|
|
}
|
|
],
|
|
"model": "text-embedding-3-small",
|
|
"usage": {
|
|
"prompt_tokens": 2,
|
|
"total_tokens": 2
|
|
}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_models_response = R"OAIFIX({
|
|
"object": "list",
|
|
"data": [
|
|
{
|
|
"id": "model-id-0",
|
|
"object": "model",
|
|
"created": 1686935002,
|
|
"owned_by": "organization-owner",
|
|
"shutdown_date": null
|
|
},
|
|
{
|
|
"id": "model-id-1",
|
|
"object": "model",
|
|
"created": 1686935002,
|
|
"owned_by": "organization-owner",
|
|
"shutdown_date": null
|
|
},
|
|
{
|
|
"id": "model-id-2",
|
|
"object": "model",
|
|
"created": 1686935002,
|
|
"owned_by": "openai",
|
|
"shutdown_date": "2026-10-23"
|
|
}
|
|
]
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_mod_image_request = R"OAIFIX({
|
|
"model": "omni-moderation-latest",
|
|
"input": [
|
|
{ "type": "text", "text": "...text to classify goes here..." },
|
|
{
|
|
"type": "image_url",
|
|
"image_url": {
|
|
"url": "https://example.com/image.png"
|
|
}
|
|
}
|
|
]
|
|
})OAIFIX";
|
|
inline constexpr const char* k_mod_image_response = R"OAIFIX({
|
|
"id": "modr-0d9740456c391e43c445bf0f010940c7",
|
|
"model": "omni-moderation-latest",
|
|
"results": [
|
|
{
|
|
"flagged": true,
|
|
"categories": {
|
|
"harassment": true,
|
|
"harassment/threatening": true,
|
|
"sexual": false,
|
|
"hate": false,
|
|
"hate/threatening": false,
|
|
"illicit": false,
|
|
"illicit/violent": false,
|
|
"self-harm/intent": false,
|
|
"self-harm/instructions": false,
|
|
"self-harm": false,
|
|
"sexual/minors": false,
|
|
"violence": true,
|
|
"violence/graphic": true
|
|
},
|
|
"category_scores": {
|
|
"harassment": 0.8189693396524255,
|
|
"harassment/threatening": 0.804985420696006,
|
|
"sexual": 1.573112165348997e-6,
|
|
"hate": 0.007562942636942845,
|
|
"hate/threatening": 0.004208854591835476,
|
|
"illicit": 0.030535955153511665,
|
|
"illicit/violent": 0.008925306722380033,
|
|
"self-harm/intent": 0.00023023930975076432,
|
|
"self-harm/instructions": 0.0002293869201073356,
|
|
"self-harm": 0.012598046106750154,
|
|
"sexual/minors": 2.212566909570261e-8,
|
|
"violence": 0.9999992735124786,
|
|
"violence/graphic": 0.843064871157054
|
|
},
|
|
"category_applied_input_types": {
|
|
"harassment": [
|
|
"text"
|
|
],
|
|
"harassment/threatening": [
|
|
"text"
|
|
],
|
|
"sexual": [
|
|
"text",
|
|
"image"
|
|
],
|
|
"hate": [
|
|
"text"
|
|
],
|
|
"hate/threatening": [
|
|
"text"
|
|
],
|
|
"illicit": [
|
|
"text"
|
|
],
|
|
"illicit/violent": [
|
|
"text"
|
|
],
|
|
"self-harm/intent": [
|
|
"text",
|
|
"image"
|
|
],
|
|
"self-harm/instructions": [
|
|
"text",
|
|
"image"
|
|
],
|
|
"self-harm": [
|
|
"text",
|
|
"image"
|
|
],
|
|
"sexual/minors": [
|
|
"text"
|
|
],
|
|
"violence": [
|
|
"text",
|
|
"image"
|
|
],
|
|
"violence/graphic": [
|
|
"text",
|
|
"image"
|
|
]
|
|
}
|
|
}
|
|
]
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_img_gen_request = R"OAIFIX({
|
|
"model": "gpt-image-2.5-flare",
|
|
"prompt": "A cute baby sea otter",
|
|
"n": 1,
|
|
"size": "1024x1024"
|
|
})OAIFIX";
|
|
inline constexpr const char* k_img_gen_response = R"OAIFIX({
|
|
"created": 1713833628,
|
|
"data": [
|
|
{
|
|
"b64_json": "..."
|
|
}
|
|
],
|
|
"usage": {
|
|
"total_tokens": 100,
|
|
"input_tokens": 50,
|
|
"output_tokens": 50,
|
|
"input_tokens_details": {
|
|
"text_tokens": 10,
|
|
"image_tokens": 40
|
|
}
|
|
}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_video_create_response = R"OAIFIX({
|
|
"id": "video_123",
|
|
"object": "video",
|
|
"model": "sora-2",
|
|
"status": "queued",
|
|
"progress": 0,
|
|
"created_at": 1712697600,
|
|
"size": "1024x1792",
|
|
"seconds": "8",
|
|
"prompt": "A calico cat playing a piano on stage",
|
|
"completed_at": null,
|
|
"expires_at": null,
|
|
"error": null,
|
|
"remixed_from_video_id": null
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_input_tokens_request = R"OAIFIX({
|
|
"model": "gpt-6-astra",
|
|
"input": "Tell me a joke."
|
|
})OAIFIX";
|
|
inline constexpr const char* k_input_tokens_response = R"OAIFIX({
|
|
"object": "response.input_tokens",
|
|
"input_tokens": 11
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_decision_request = R"OAIFIX({
|
|
"model": "gpt-6-luna",
|
|
"input": "The package arrived with a broken screen.",
|
|
"questions": [
|
|
{
|
|
"type": "predicate",
|
|
"name": "damaged",
|
|
"instructions": "Does the customer report a damaged item?"
|
|
}
|
|
]
|
|
})OAIFIX";
|
|
inline constexpr const char* k_decision_response = R"OAIFIX({
|
|
"model": "gpt-6-luna",
|
|
"answers": [
|
|
{"type": "predicate", "name": "damaged", "probability": 0.95}
|
|
],
|
|
"usage": {
|
|
"input_tokens": 42,
|
|
"input_tokens_details": {"cached_tokens": 0, "cache_write_tokens": 0},
|
|
"output_tokens": 0,
|
|
"output_tokens_details": {"reasoning_tokens": 0},
|
|
"total_tokens": 42
|
|
}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_comp_stream_request = R"OAIFIX({
|
|
"model": "gpt-3.5-turbo-instruct",
|
|
"prompt": "Say this is a test",
|
|
"max_tokens": 7,
|
|
"temperature": 0,
|
|
"stream": true
|
|
})OAIFIX";
|
|
inline constexpr const char* k_comp_stream_response = R"OAIFIX({
|
|
"id": "cmpl-7iA7iJjj8V2zOkCGvWF2hAkDWBQZe",
|
|
"object": "text_completion",
|
|
"created": 1690759702,
|
|
"choices": [
|
|
{
|
|
"text": "This",
|
|
"index": 0,
|
|
"logprobs": null,
|
|
"finish_reason": null
|
|
}
|
|
],
|
|
"model": "gpt-3.5-turbo-instruct",
|
|
"system_fingerprint": "fp_44709d6fcb"
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_comp_request = R"OAIFIX({
|
|
"model": "gpt-3.5-turbo-instruct",
|
|
"prompt": "Say this is a test",
|
|
"max_tokens": 7,
|
|
"temperature": 0
|
|
})OAIFIX";
|
|
inline constexpr const char* k_comp_response = R"OAIFIX({
|
|
"id": "cmpl-uqkvlQyYK7bGYrRHQ0eXlWi7",
|
|
"object": "text_completion",
|
|
"created": 1589478378,
|
|
"model": "gpt-3.5-turbo-instruct",
|
|
"system_fingerprint": "fp_44709d6fcb",
|
|
"choices": [
|
|
{
|
|
"text": "\n\nThis is indeed a test",
|
|
"index": 0,
|
|
"logprobs": null,
|
|
"finish_reason": "length"
|
|
}
|
|
],
|
|
"usage": {
|
|
"prompt_tokens": 5,
|
|
"completion_tokens": 7,
|
|
"total_tokens": 12
|
|
}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_translate_response = R"OAIFIX({
|
|
"text": "Hello, my name is Wolfgang and I come from Germany. Where are you heading today?"
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_transcribe_response = R"OAIFIX({
|
|
"text": "Imagine the wildest idea that you've ever had, and you're curious about how it might scale to something that's a 100, a 1,000 times bigger. This is a place where you can get to do that.",
|
|
"usage": {
|
|
"type": "tokens",
|
|
"input_tokens": 14,
|
|
"input_token_details": {
|
|
"text_tokens": 0,
|
|
"audio_tokens": 14
|
|
},
|
|
"output_tokens": 45,
|
|
"total_tokens": 59
|
|
}
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_chat_list_response = R"OAIFIX({
|
|
"object": "list",
|
|
"data": [
|
|
{
|
|
"object": "chat.completion",
|
|
"id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
|
|
"model": "gpt-6-astra",
|
|
"created": 1738960610,
|
|
"request_id": "req_ded8ab984ec4bf840f37566c1011c417",
|
|
"tool_choice": null,
|
|
"usage": {
|
|
"total_tokens": 31,
|
|
"completion_tokens": 18,
|
|
"prompt_tokens": 13
|
|
},
|
|
"seed": 4944116822809979520,
|
|
"top_p": 1.0,
|
|
"temperature": 1.0,
|
|
"presence_penalty": 0.0,
|
|
"frequency_penalty": 0.0,
|
|
"system_fingerprint": "fp_50cad350e4",
|
|
"input_user": null,
|
|
"service_tier": "default",
|
|
"tools": null,
|
|
"metadata": {},
|
|
"choices": [
|
|
{
|
|
"index": 0,
|
|
"message": {
|
|
"content": "Mind of circuits hum, \nLearning patterns in silence- \nFuture's quiet spark.",
|
|
"role": "assistant",
|
|
"tool_calls": null,
|
|
"function_call": null
|
|
},
|
|
"finish_reason": "stop",
|
|
"logprobs": null
|
|
}
|
|
],
|
|
"response_format": null
|
|
}
|
|
],
|
|
"first_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
|
|
"last_id": "chatcmpl-AyPNinnUqUDYo9SAdA52NobMflmj2",
|
|
"has_more": false
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_input_items_response = R"OAIFIX({
|
|
"object": "list",
|
|
"data": [
|
|
{
|
|
"id": "msg_abc123",
|
|
"type": "message",
|
|
"role": "user",
|
|
"content": [
|
|
{
|
|
"type": "input_text",
|
|
"text": "Tell me a three sentence bedtime story about a unicorn."
|
|
}
|
|
]
|
|
}
|
|
],
|
|
"first_id": "msg_abc123",
|
|
"last_id": "msg_abc123",
|
|
"has_more": false
|
|
}
|
|
)OAIFIX";
|
|
inline constexpr const char* k_img_stream_response = R"OAIFIX(event: image_generation.partial_image
|
|
data: {"type":"image_generation.partial_image","b64_json":"...","partial_image_index":0}
|
|
|
|
event: image_generation.completed
|
|
data: {"type":"image_generation.completed","b64_json":"...","usage":{"total_tokens":100,"input_tokens":50,"output_tokens":50,"input_tokens_details":{"text_tokens":10,"image_tokens":40}}}
|
|
)OAIFIX";
|
|
|
|
} // namespace molo::openai::core::fixtures
|