Skip to content

Commit

Permalink
feat: use agent directly, no live prop
Browse files Browse the repository at this point in the history
  • Loading branch information
naomi-lgbt committed Oct 31, 2024
1 parent 39ec1f8 commit 93c1feb
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 28 deletions.
2 changes: 1 addition & 1 deletion examples/node-agent-live/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ const agent = async () => {
let audioBuffer = Buffer.alloc(0);
let i = 0;
const url = "https://dpgr.am/spacewalk.wav";
const connection = deepgram.agent.live();
const connection = deepgram.agent();
connection.on(AgentEvents.Open, async () => {
console.log("Connection opened");

Expand Down
10 changes: 5 additions & 5 deletions src/DeepgramClient.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { DeepgramVersionError } from "./lib/errors";
import {
AbstractClient,
AgentLiveClient,
ListenClient,
ManageClient,
ReadClient,
OnPremClient,
SelfHostedRestClient,
SpeakClient,
ModelsRestClient,
AgentClient,
} from "./packages";

/**
Expand Down Expand Up @@ -82,13 +82,13 @@ export default class DeepgramClient extends AbstractClient {
}

/**
* Returns a new instance of the AgentClient, which provides access to Deepgram's Voice Agent API.
* Returns a new instance of the AgentLiveClient, which provides access to Deepgram's Voice Agent API.
*
* @returns {AgentClient} A new instance of the AgentClient.
* @returns {AgentLiveClient} A new instance of the AgentLiveClient.
* @beta
*/
get agent(): any {
return new AgentClient(this.options);
public agent(endpoint: string = "/agent"): AgentLiveClient {
return new AgentLiveClient(this.options, endpoint);
}

/**
Expand Down
21 changes: 0 additions & 21 deletions src/packages/AgentClient.ts

This file was deleted.

2 changes: 1 addition & 1 deletion src/packages/index.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export * from "./AbstractClient";
export * from "./AbstractLiveClient";
export * from "./AbstractRestClient";
export * from "./AgentClient";
export * from "./AgentLiveClient";
export * from "./ListenClient";
export * from "./ListenLiveClient";
export * from "./ListenRestClient";
Expand Down

0 comments on commit 93c1feb

Please sign in to comment.