feat: switch to OpenRouter for web search integration

This commit is contained in:
Yiyang Kang 2025-09-19 15:11:45 +09:00
parent 07d2042eb7
commit 7fd8146ec5
7 changed files with 33 additions and 29 deletions

View file

@ -29,6 +29,14 @@ func NewClient(apiKey string) *Client {
return &Client{rest: cli}
}
func NewClientWithBaseUrl(apiKey string, baseURL string) *Client {
cli := NewClient(apiKey)
if baseURL != "" {
cli.rest.SetBaseURL(baseURL)
}
return cli
}
func (c *Client) ChatCompletion(request ChatRequest) (*ChatResponse, error) {
// Note: this function might not work due to the header timeout set on the http client.
// We should probably not use this anyway.