Skip to content

Commit

Permalink
Merge pull request #1 from tomguluson92/tomguluson92-patch-1
Browse files Browse the repository at this point in the history
Update generation.ts
  • Loading branch information
tomguluson92 authored Nov 23, 2024
2 parents a9d8417 + f5c0bea commit b96b96a
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ export async function generateText({
);

switch (provider) {
// OPENAI & LLAMACLOUD shared same structure.
case ModelProviderName.OPENAI:
case ModelProviderName.LLAMACLOUD: {
elizaLogger.debug("Initializing OpenAI model.");
Expand All @@ -139,7 +140,7 @@ export async function generateText({
case ModelProviderName.GOOGLE: {
const google = createGoogleGenerativeAI();

const { text: anthropicResponse } = await aiGenerateText({
const { text: googleResponse } = await aiGenerateText({
model: google(model),
prompt: context,
system:
Expand All @@ -152,7 +153,8 @@ export async function generateText({
presencePenalty: presence_penalty,
});

response = anthropicResponse;
response = googleResponse;
elizaLogger.debug("Received response from Google model.");
break;
}

Expand Down Expand Up @@ -280,7 +282,7 @@ export async function generateText({
const serverUrl = models[provider].endpoint;
const openai = createOpenAI({ apiKey, baseURL: serverUrl });

const { text: openaiResponse } = await aiGenerateText({
const { text: redpillResponse } = await aiGenerateText({
model: openai.languageModel(model),
prompt: context,
temperature: temperature,
Expand All @@ -293,8 +295,8 @@ export async function generateText({
presencePenalty: presence_penalty,
});

response = openaiResponse;
elizaLogger.debug("Received response from OpenAI model.");
response = redpillResponse;
elizaLogger.debug("Received response from redpill model.");
break;
}

Expand Down

0 comments on commit b96b96a

Please sign in to comment.