Skip to content

Commit

Permalink
handel infera provider
Browse files Browse the repository at this point in the history
  • Loading branch information
tcm390 committed Jan 10, 2025
1 parent 3d7ae2b commit 2d37afe
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -830,6 +830,37 @@ export async function generateText({
break;
}

case ModelProviderName.INFERA: {
elizaLogger.debug("Initializing Infera model.");

const apiKey = settings.INFERA_API_KEY || runtime.token;

const infera = createOpenAI({
apiKey,
baseURL: endpoint,
headers: {
api_key: apiKey,
"Content-Type": "application/json",
},
});

const { text: inferaResponse } = await aiGenerateText({
model: infera.languageModel(model),
prompt: context,
system:
runtime.character.system ??
settings.SYSTEM_PROMPT ??
undefined,
temperature: temperature,
maxTokens: max_response_length,
frequencyPenalty: frequency_penalty,
presencePenalty: presence_penalty,
});
response = inferaResponse;
elizaLogger.debug("Received response from Infera model.");
break;
}

case ModelProviderName.VENICE: {
elizaLogger.debug("Initializing Venice model.");
const venice = createOpenAI({
Expand Down

0 comments on commit 2d37afe

Please sign in to comment.