Skip to content

Commit

Permalink
fix: fail when cannot get token, add Akash to generateText switch
Browse files Browse the repository at this point in the history
  • Loading branch information
vpavlin committed Dec 18, 2024
1 parent 81d0273 commit 92bf8f0
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions agent/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -304,6 +304,10 @@ export function getTokenForProvider(
character.settings?.secrets?.AKASH_CHAT_API_KEY ||
settings.AKASH_CHAT_API_KEY
);
default:
const errorMessage = `Failed to get token - unsupported model provider: ${provider}`
elizaLogger.error(errorMessage)
throw new Error(errorMessage)
}
}

Expand Down
3 changes: 2 additions & 1 deletion packages/core/src/generation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,8 @@ export async function generateText({
case ModelProviderName.LLAMACLOUD:
case ModelProviderName.NANOGPT:
case ModelProviderName.HYPERBOLIC:
case ModelProviderName.TOGETHER: {
case ModelProviderName.TOGETHER:
case ModelProviderName.AKASH_CHAT_API: {
elizaLogger.debug("Initializing OpenAI model.");
const openai = createOpenAI({
apiKey,
Expand Down

0 comments on commit 92bf8f0

Please sign in to comment.