Dear OpenRouter Team.
package main
import(
"context"
"os"
openrouter "github.com/OpenRouterTeam/go-sdk"
"github.com/OpenRouterTeam/go-sdk/models/components"
"log"
)
func main() {
ctx := context.Background()
s := openrouter.New(
openrouter.WithSecurity(os.Getenv("OPENROUTER_API_KEY")),
)
res, err := s.Chat.Send(ctx, components.ChatRequest{
Messages: []components.ChatMessages{
components.CreateChatMessagesSystem(
components.ChatSystemMessage{
Content: components.CreateChatSystemMessageContentStr(
"You are a helpful assistant.",
),
Role: components.ChatSystemMessageRoleSystem,
},
),
components.CreateChatMessagesUser(
components.ChatUserMessage{
Content: components.CreateChatUserMessageContentStr(
"What is the capital of France?",
),
Role: components.ChatUserMessageRoleUser,
},
),
},
}, nil)
if err != nil {
log.Fatal(err)
}
if res != nil {
defer res.ChatStreamingResponse.Close()
for res.ChatStreamingResponse.Next() {
event := res.ChatStreamingResponse.Value()
log.Print(event)
// Handle the event
}
}
}
Dear OpenRouter Team.
Steps to reproduce the issue:
Just copy and paste the Send example in documentation
What we get:
res.ChatStreamingResponse undefined (type *operations.SendChatCompletionRequestResponse has no field or method ChatStreamingResponse)