Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"format": "prettier --write src/**/*.ts"
},
"dependencies": {
"@elevenlabs/elevenlabs-js": "2.29.0",
"@elevenlabs/elevenlabs-js": "2.36.0",
"@inkjs/ui": "^2.0.0",
"@types/read": "^0.0.32",
"chalk": "^5.3.0",
Expand Down
10 changes: 5 additions & 5 deletions pnpm-lock.yaml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions src/shared/elevenlabs-api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,7 @@ export async function getToolDependentAgentsApi(client: ElevenLabsClient, toolId
* @param testConfig - The test configuration object
* @returns Promise that resolves to the created test with ID
*/
export async function createTestApi(client: ElevenLabsClient, testConfig: ElevenLabs.conversationalAi.CreateUnitTestRequest): Promise<{ id: string }> {
export async function createTestApi(client: ElevenLabsClient, testConfig: ElevenLabs.conversationalAi.TestsCreateRequestBody): Promise<{ id: string }> {
const response = await client.conversationalAi.tests.create(testConfig);
return response as { id: string };
}
Expand Down Expand Up @@ -375,7 +375,7 @@ export async function listTestsApi(client: ElevenLabsClient, pageSize: number =
* @param testConfig - The updated test configuration object
* @returns Promise that resolves to the updated test object
*/
export async function updateTestApi(client: ElevenLabsClient, testId: string, testConfig: ElevenLabs.conversationalAi.UpdateUnitTestRequest): Promise<unknown> {
export async function updateTestApi(client: ElevenLabsClient, testId: string, testConfig: ElevenLabs.conversationalAi.TestsUpdateRequestBody): Promise<unknown> {
const response = await client.conversationalAi.tests.update(testId, testConfig);
return toSnakeCaseKeys(response);
}
Expand Down
6 changes: 4 additions & 2 deletions src/tests/__tests__/test-api.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ describe("Test API Functions", () => {

const result = await createTestApi(
mockClient as unknown as ElevenLabsClient,
testConfig as ElevenLabs.conversationalAi.CreateUnitTestRequest
testConfig as ElevenLabs.conversationalAi.TestsCreateRequestBody
);

expect(mockClient.conversationalAi.tests.create).toHaveBeenCalledWith(
Expand All @@ -82,7 +82,7 @@ describe("Test API Functions", () => {
await expect(
createTestApi(
mockClient as unknown as ElevenLabsClient,
testConfig as ElevenLabs.conversationalAi.CreateUnitTestRequest
testConfig as ElevenLabs.conversationalAi.TestsCreateRequestBody
)
).rejects.toThrow("API Error");
});
Expand Down Expand Up @@ -181,6 +181,7 @@ describe("Test API Functions", () => {
mockClient.conversationalAi.tests.update.mockResolvedValue(mockResponse);

const testConfig = {
type: "llm" as const,
name: "Updated Test",
chatHistory: [{ role: "user" as const, timeInCallSecs: 1 }],
successCondition: "The agent responds appropriately",
Expand Down Expand Up @@ -392,6 +393,7 @@ describe("Test API Functions", () => {
);

const validTestConfig = {
type: "llm" as const,
name: "Test",
chatHistory: [{ role: "user" as const, timeInCallSecs: 1 }],
successCondition: "Test condition",
Expand Down
6 changes: 3 additions & 3 deletions src/tests/commands/impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ async function addTest(name: string, templateType: string = "basic-llm"): Promis
const client = await getElevenLabsClient();

try {
const testApiConfig = toCamelCaseKeys(testConfig) as unknown as ElevenLabs.conversationalAi.CreateUnitTestRequest;
const testApiConfig = toCamelCaseKeys(testConfig) as unknown as ElevenLabs.conversationalAi.TestsCreateRequestBody;
const response = await createTestApi(client, testApiConfig);
const testId = response.id;

Expand Down Expand Up @@ -163,7 +163,7 @@ async function pushTests(testId?: string, dryRun = false): Promise<void> {

// Perform API operation
try {
const testApiConfig = toCamelCaseKeys(testConfig) as unknown as ElevenLabs.conversationalAi.CreateUnitTestRequest;
const testApiConfig = toCamelCaseKeys(testConfig) as unknown as ElevenLabs.conversationalAi.TestsCreateRequestBody;

if (!testId) {
// Create new test
Expand All @@ -176,7 +176,7 @@ async function pushTests(testId?: string, dryRun = false): Promise<void> {
changesMade = true;
} else {
// Update existing test
await updateTestApi(client, testId, testApiConfig as ElevenLabs.conversationalAi.UpdateUnitTestRequest);
await updateTestApi(client, testId, testApiConfig as ElevenLabs.conversationalAi.TestsUpdateRequestBody);
console.log(`Updated test ${testDefName} (ID: ${testId})`);
}

Expand Down
Loading