-
Notifications
You must be signed in to change notification settings - Fork 17
feat: add simple helpers for various providers #41
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for two new AI providers (ZAI and XAI) by creating OpenAI-compatible wrappers for their APIs. The implementation includes comprehensive test coverage with VCR recordings for various interaction patterns (simple, streaming, tool usage).
- New ZAI provider implementation with OpenAI compatibility layer
- New XAI provider implementation with OpenAI compatibility layer
- Comprehensive test data for both providers covering simple queries, streaming, and tool calling scenarios
Reviewed Changes
Copilot reviewed 38 out of 40 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| providers/zai/zai.go | Implements ZAI provider wrapper with OpenAI-compatible API |
| providertests/zai_test.go | Test suite for ZAI provider |
| providertests/xai_test.go | Test suite for XAI provider |
| providertests/testdata/TestZAICommon/zai-glm-4.6/*.yaml | VCR test recordings for ZAI provider interactions |
| providertests/testdata/TestXAICommon/xai-grok-code-fast/*.yaml | VCR test recordings for XAI provider interactions |
| providertests/testdata/TestGroqCommon/groq-kimi-k2-0905/simple.yaml | VCR recording for Groq Kimi model test |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
| if err != nil { | ||
| return nil, err | ||
| } | ||
| return provider.LanguageModel(t.Context(), "grok-code-fast-1") |
Copilot
AI
Oct 23, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The model name in the test data is "grok-code-fast-1" but the test case name is "xai-grok-code-fast". These should be consistent to avoid confusion and potential test failures if the model name changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nahh dude its fine.
…isfy revive\n\n💘 Generated with Crush\n\n\nCo-Authored-By: Crush <[email protected]>\n
This combines: - PR charmbracelet#41: ZAI provider (and XAI, Groq, Cerebras, Huggingface providers) - ExtraFields support for OpenAI and OpenAI-compatible providers The ZAI provider uses openaicompat under the hood, so it will automatically benefit from ExtraFields for Z.AI GLM thinking mode.
No description provided.