mirror of
https://github.com/whit3rabbit/anyllm-proxy.git
synced 2026-09-22 00:00:50 +00:00
Rust workspace with two crates: - translator: pure, IO-free mapping between Anthropic Messages API and OpenAI Chat Completions - proxy: axum HTTP server with auth, streaming SSE, retry/backoff, concurrency limits 169 tests passing (unit, golden fixture, integration). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
53 lines
1.2 KiB
JSON
53 lines
1.2 KiB
JSON
{
|
|
"request": {
|
|
"model": "gpt-5.4",
|
|
"messages": [
|
|
{ "role": "user", "content": "What is the S&P 500 at today?" }
|
|
],
|
|
"tools": [
|
|
{
|
|
"type": "function",
|
|
"function": {
|
|
"name": "get_stock_price",
|
|
"description": "Get the latest price for an index or ticker.",
|
|
"parameters": {
|
|
"type": "object",
|
|
"properties": { "ticker": { "type": "string" } },
|
|
"required": ["ticker"]
|
|
}
|
|
}
|
|
}
|
|
],
|
|
"tool_choice": "required"
|
|
},
|
|
"response": {
|
|
"id": "chatcmpl-def456",
|
|
"object": "chat.completion",
|
|
"model": "gpt-5.4",
|
|
"choices": [
|
|
{
|
|
"index": 0,
|
|
"message": {
|
|
"role": "assistant",
|
|
"tool_calls": [
|
|
{
|
|
"id": "call_xyz789",
|
|
"type": "function",
|
|
"function": {
|
|
"name": "get_stock_price",
|
|
"arguments": "{\"ticker\":\"^GSPC\"}"
|
|
}
|
|
}
|
|
]
|
|
},
|
|
"finish_reason": "tool_calls"
|
|
}
|
|
],
|
|
"usage": {
|
|
"prompt_tokens": 50,
|
|
"completion_tokens": 15,
|
|
"total_tokens": 65
|
|
}
|
|
}
|
|
}
|