From adfa6bd78389e01e2b5a6a6d71a718a2c9f10298 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 24 Nov 2025 18:30:46 +0300 Subject: Feat: tool model for or --- models/openrouter.go | 1 + 1 file changed, 1 insertion(+) (limited to 'models/openrouter.go') diff --git a/models/openrouter.go b/models/openrouter.go index 933598e..ac37a85 100644 --- a/models/openrouter.go +++ b/models/openrouter.go @@ -31,6 +31,7 @@ type OpenRouterChatReq struct { Temperature float32 `json:"temperature"` MinP float32 `json:"min_p"` NPredict int32 `json:"max_tokens"` + Tools []Tool `json:"tools"` } func NewOpenRouterChatReq(cb ChatBody, props map[string]float32) OpenRouterChatReq { -- cgit v1.2.3 From fc963f86c94f8d96224414e409fda757f3b2d11d Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Mon, 24 Nov 2025 19:08:34 +0300 Subject: Feat: parse func call from or --- models/openrouter.go | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'models/openrouter.go') diff --git a/models/openrouter.go b/models/openrouter.go index ac37a85..50f26b6 100644 --- a/models/openrouter.go +++ b/models/openrouter.go @@ -57,10 +57,11 @@ type OpenRouterChatRespNonStream struct { NativeFinishReason string `json:"native_finish_reason"` Index int `json:"index"` Message struct { - Role string `json:"role"` - Content string `json:"content"` - Refusal any `json:"refusal"` - Reasoning any `json:"reasoning"` + Role string `json:"role"` + Content string `json:"content"` + Refusal any `json:"refusal"` + Reasoning any `json:"reasoning"` + ToolCalls []ToolDeltaResp `json:"tool_calls"` } `json:"message"` } `json:"choices"` Usage struct { @@ -79,8 +80,9 @@ type OpenRouterChatResp struct { Choices []struct { Index int `json:"index"` Delta struct { - Role string `json:"role"` - Content string `json:"content"` + Role string `json:"role"` + Content string `json:"content"` + ToolCalls []ToolDeltaResp `json:"tool_calls"` } `json:"delta"` FinishReason string `json:"finish_reason"` NativeFinishReason string `json:"native_finish_reason"` -- cgit v1.2.3