#Gemini Client 🧵
1 messages · Page 1 of 1 (latest)
Sure 🙏
first difference I ran into is that the gemini constructor is like NewClient(ctx, opts...) (*Client, error). No problem bubbling up the error but I didn't see a clear way to wire through the ctx. For now I just have ctx := context.Background() //FIXME
Next hurdle, the tool schema does not have an easy conversion like openai and anthropic so I'm building a converter
tool schema mapped ✅
In
type ModelMessage struct {
Role string `json:"role"`
Content any `json:"content"`
ToolCalls []ToolCall `json:"tool_calls,omitempty"`
ToolCallID string `json:"tool_call_id,omitempty"`
ToolErrored bool `json:"tool_errored,omitempty"`
}
will the output from the tool call be in Content? What is it's format?
I guess this implies yes?
if msg.ToolCallID != "" {
blocks = append(blocks, anthropic.NewToolResultBlock(
msg.ToolCallID,
content,
msg.ToolErrored,
))
}
also, does that mean ToolCallID should exist as a ToolCall.ID in ModelMessage.ToolCalls?
yes 👍