mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-12 23:30:35 +00:00
* feat(relaykit): preserve hosted tools across conversions - add protocol-neutral hosted-tool DTOs, conversion metadata, and loss policies - bridge citations, grounding metadata, and hosted-tool stream lifecycles - document the public conversion behavior and channel policy controls * refactor(relaykit): normalize reasoning and thinking intent - centralize provider-neutral reasoning intent, effort, and budget mappings - parse model suffixes at the host entry boundary while preserving provider-owned tails - keep adaptive Claude thinking and explicit zero-token compatibility consistent * fix(billing): preserve authoritative usage across relay hops - carry native BillingUsage sidecars through direct and streamed protocol bridges - merge partial and terminal usage monotonically with safe fallback settlement - retain cache metadata, penultimate usage, and per-call Gemini tool surcharges * feat(relay): bridge Responses with Claude and Gemini protocols - add direct request, response, and stream converters across supported relay formats - expose Claude count_tokens and Chat-to-Responses compatibility endpoints - carry conversion diagnostics through the host while retaining the curated public goldens * fix(relay): wire relaykit conversions into host channels - connect handlers, adaptors, and channel settings to the standalone conversion layer - keep model mapping, pricing identity, retries, and provider-specific suffix behavior aligned - ignore local audit artifacts and retain focused public regression coverage
83 lines
1.9 KiB
JSON
83 lines
1.9 KiB
JSON
{
|
|
"events": [
|
|
{
|
|
"type": "message_start",
|
|
"message": {
|
|
"type": "message",
|
|
"model": "upstream-model",
|
|
"usage": {
|
|
"input_tokens": 0,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"output_tokens": 0,
|
|
"claude_cache_creation_5_m_tokens": 0,
|
|
"claude_cache_creation_1_h_tokens": 0
|
|
},
|
|
"role": "assistant",
|
|
"id": "stream_fixed",
|
|
"content": []
|
|
}
|
|
},
|
|
{
|
|
"type": "content_block_start",
|
|
"index": 0,
|
|
"content_block": {
|
|
"type": "text",
|
|
"text": ""
|
|
}
|
|
},
|
|
{
|
|
"type": "content_block_delta",
|
|
"index": 0,
|
|
"delta": {
|
|
"type": "text_delta",
|
|
"text": "Hello"
|
|
}
|
|
},
|
|
{
|
|
"type": "content_block_delta",
|
|
"index": 0,
|
|
"delta": {
|
|
"type": "text_delta",
|
|
"text": " world"
|
|
}
|
|
},
|
|
{
|
|
"type": "content_block_stop",
|
|
"index": 0
|
|
},
|
|
{
|
|
"type": "message_delta",
|
|
"usage": {
|
|
"input_tokens": 4,
|
|
"cache_creation_input_tokens": 0,
|
|
"cache_read_input_tokens": 0,
|
|
"output_tokens": 2,
|
|
"claude_cache_creation_5_m_tokens": 0,
|
|
"claude_cache_creation_1_h_tokens": 0,
|
|
"billing_usage": {
|
|
"source": "gemini_chat",
|
|
"semantic": "gemini",
|
|
"gemini_usage_metadata": {
|
|
"promptTokenCount": 4,
|
|
"toolUsePromptTokenCount": 0,
|
|
"candidatesTokenCount": 2,
|
|
"totalTokenCount": 6,
|
|
"thoughtsTokenCount": 0,
|
|
"cachedContentTokenCount": 0,
|
|
"promptTokensDetails": [],
|
|
"toolUsePromptTokensDetails": [],
|
|
"candidatesTokensDetails": []
|
|
}
|
|
}
|
|
},
|
|
"delta": {
|
|
"stop_reason": "end_turn"
|
|
}
|
|
},
|
|
{
|
|
"type": "message_stop"
|
|
}
|
|
]
|
|
}
|