Skip to content

Commit

Permalink
fixing-retell (#415)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shyam-Raghuwanshi authored Nov 5, 2024
1 parent 5f5c031 commit cebe660
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 12 deletions.
2 changes: 1 addition & 1 deletion JS/edgechains/arakoodev/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
"regenerator-runtime": "^0.14.1",
"request": "^2.88.2",
"retell-client-js-sdk": "^2.0.4",
"retell-sdk": "^4.7.0",
"retell-sdk": "^4.9.0",
"retry": "^0.13.1",
"ts-node": "^10.9.2",
"typeorm": "^0.3.20",
Expand Down
16 changes: 5 additions & 11 deletions JS/edgechains/arakoodev/src/ai/src/lib/retell-ai/retell.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,17 @@ import { AgentCreateParams, AgentResponse } from "retell-sdk/resources/agent.mjs
import { LlmResponse, LlmCreateParams } from "retell-sdk/resources/llm.mjs";
export class RetellAI {
retellClient: Retell;
llm: null | LlmResponse;
llm: LlmResponse | null;
constructor(apiKey: string) {
this.retellClient = new Retell({
apiKey: apiKey,
});
this.llm = null;
}

async createAgent(
body: AgentCreateParams,
options?: Retell.RequestOptions
): Promise<AgentResponse> {
const defaultParams = {
voice_id: "11labs-Adrian",
agent_name: "Ryan",
llm_websocket_url: this?.llm?.llm_websocket_url,
};
async createAgent(body: AgentCreateParams, options?: Retell.RequestOptions): Promise<AgentResponse> {
//@ts-ignore
const defaultParams = { voice_id: "11labs-Adrian", agent_name: "Ryan", llm_websocket_url: this?.llm?.llm_websocket_url }
const keys = Object.keys(defaultParams);
for (let i = 0; i < keys.length; i++) {
if (keys[i] in body) {
Expand All @@ -39,4 +33,4 @@ export class RetellAI {
const webCallResponse = await this.retellClient.call.createWebCall({ agent_id });
return webCallResponse.access_token;
}
}
}

0 comments on commit cebe660

Please sign in to comment.