-
Notifications
You must be signed in to change notification settings - Fork 0
fix(openai): support gpt-5-nano parameters #22
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
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -12,14 +12,19 @@ class XAI extends OpenAI | |
| protected const ENDPOINT = 'https://api.x.ai/v1/chat/completions'; | ||
|
|
||
| /** | ||
| * Grok 2 Latest - Latest Grok model | ||
| * Grok 3 - Latest Grok model | ||
| */ | ||
| public const MODEL_GROK_2_LATEST = 'grok-2-latest'; | ||
| public const MODEL_GROK_3 = 'grok-3'; | ||
|
|
||
| /** | ||
| * Grok 3 Mini - Mini version of grok 3 | ||
| */ | ||
| public const MODEL_GROK_3_MINI = 'grok-3-mini'; | ||
|
Comment on lines
+15
to
+22
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: rg -n 'MODEL_GROK_2_LATEST' --type=phpRepository: utopia-php/agents Length of output: 43 🏁 Script executed: cat -n src/Agents/Adapters/XAI.php | head -100Repository: utopia-php/agents Length of output: 2780 🏁 Script executed: git log --oneline -n 20 src/Agents/Adapters/XAI.phpRepository: utopia-php/agents Length of output: 91 🏁 Script executed: git show 430ad21:src/Agents/Adapters/XAI.php | head -100Repository: utopia-php/agents Length of output: 2080 🏁 Script executed: git log --oneline --follow -- src/Agents/Adapters/XAI.phpRepository: utopia-php/agents Length of output: 91 🏁 Script executed: git log --all --diff-filter=A -- src/Agents/Adapters/XAI.phpRepository: utopia-php/agents Length of output: 441 🏁 Script executed: git show c22aa7a --name-status | grep -i xaiRepository: utopia-php/agents Length of output: 142 🏁 Script executed: git show c22aa7a:src/Agents/Adapters/XAI.php | head -100Repository: utopia-php/agents Length of output: 2070 🏁 Script executed: git show c22aa7a -- src/Agents/Adapters/XAI.php | grep -A 5 -B 5 "MODEL_GROK_2_LATEST"Repository: utopia-php/agents Length of output: 901 🏁 Script executed: git log --oneline --all -- src/Agents/Adapters/XAI.phpRepository: utopia-php/agents Length of output: 178 Removal of The Additionally, 🤖 Prompt for AI Agents |
||
|
|
||
| /** | ||
| * Grok 2 Image - Latest Grok model with image support | ||
| */ | ||
| public const MODEL_GROK_2_IMAGE = 'grok-2-image'; | ||
| public const MODEL_GROK_2_IMAGE = 'grok-2-image-1212'; | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The model string changed to 🤖 Prompt for AI Agents |
||
|
|
||
| /** | ||
| * Create a new XAI adapter | ||
|
|
@@ -35,7 +40,7 @@ class XAI extends OpenAI | |
| */ | ||
| public function __construct( | ||
| string $apiKey, | ||
| string $model = self::MODEL_GROK_2_LATEST, | ||
| string $model = self::MODEL_GROK_3_MINI, | ||
| int $maxTokens = 1024, | ||
| float $temperature = 1.0, | ||
| ?string $endpoint = null, | ||
|
|
@@ -69,7 +74,8 @@ public function isSchemaSupported(): bool | |
| public function getModels(): array | ||
| { | ||
| return [ | ||
| self::MODEL_GROK_2_LATEST, | ||
| self::MODEL_GROK_3, | ||
| self::MODEL_GROK_3_MINI, | ||
| self::MODEL_GROK_2_IMAGE, | ||
| ]; | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.