diff --git a/src/conversation/remote-conversation.ts b/src/conversation/remote-conversation.ts index e568867..63df573 100644 --- a/src/conversation/remote-conversation.ts +++ b/src/conversation/remote-conversation.ts @@ -81,10 +81,8 @@ export class RemoteConversation { } async conversationStats(): Promise { - const response = await this.client.get( - `/api/conversations/${this.id}/stats` - ); - return response.data; + const response = await this.client.get(`/api/conversations/${this.id}`); + return response.data.stats; } async sendMessage(message: string | Message): Promise { @@ -104,7 +102,7 @@ export class RemoteConversation { }; } - await this.client.post(`/api/conversations/${this.id}/send_message`, messageContent); + await this.client.post(`/api/conversations/${this.id}/events`, messageContent); } async run(): Promise { @@ -116,12 +114,12 @@ export class RemoteConversation { } async setConfirmationPolicy(policy: ConfirmationPolicyBase): Promise { - await this.client.post(`/api/conversations/${this.id}/set_confirmation_policy`, policy); + await this.client.post(`/api/conversations/${this.id}/confirmation_policy`, policy); } async sendConfirmationResponse(accept: boolean, reason?: string): Promise { const request: ConfirmationResponseRequest = { accept, reason }; - await this.client.post(`/api/conversations/${this.id}/send_confirmation_response`, request); + await this.client.post(`/api/conversations/${this.id}/events/respond_to_confirmation`, request); } async generateTitle(maxLength: number = 50, llm?: any): Promise { @@ -145,7 +143,7 @@ export class RemoteConversation { } const request: UpdateSecretsRequest = { secrets: secretStrings }; - await this.client.post(`/api/conversations/${this.id}/update_secrets`, request); + await this.client.post(`/api/conversations/${this.id}/secrets`, request); } async startWebSocketClient(): Promise {