Skip to content

Commit

Permalink
Merge pull request elizaOS#216 from MeDott29/implement-grok-beta
Browse files Browse the repository at this point in the history
Implement grok beta
  • Loading branch information
lalalune authored Nov 6, 2024
2 parents 84d5b10 + 6853b43 commit 39ce28e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion core/src/core/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,8 @@ export async function generateText({

case ModelProvider.GROK: {
prettyConsole.log("Initializing Grok model.");
const grok = createGroq({ apiKey });
const serverUrl = models[provider].endpoint;
const grok = createOpenAI({ apiKey, baseURL: serverUrl });

const { text: grokResponse } = await aiGenerateText({
model: grok.languageModel(model, {
Expand Down
8 changes: 4 additions & 4 deletions core/src/core/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,10 +74,10 @@ const models: Models = {
},
endpoint: "https://api.x.ai/v1",
model: {
[ModelClass.SMALL]: "grok-2-beta",
[ModelClass.MEDIUM]: "grok-2-beta",
[ModelClass.LARGE]: "grok-2-beta",
[ModelClass.EMBEDDING]: "grok-2-beta", // not sure about this one
[ModelClass.SMALL]: "grok-beta",
[ModelClass.MEDIUM]: "grok-beta",
[ModelClass.LARGE]: "grok-beta",
[ModelClass.EMBEDDING]: "grok-beta", // not sure about this one
},
},
[ModelProvider.GROQ]: {
Expand Down

0 comments on commit 39ce28e

Please sign in to comment.