Skip to content

Commit 6cea28d

Browse files
authored
Merge pull request #9 from All-Hands-AI/fix-api-endpoints
Fix incorrect API endpoints in RemoteConversation
2 parents 5ac6dcb + e95e986 commit 6cea28d

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

src/conversation/remote-conversation.ts

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,8 @@ export class RemoteConversation {
8181
}
8282

8383
async conversationStats(): Promise<ConversationStats> {
84-
const response = await this.client.get<ConversationStats>(
85-
`/api/conversations/${this.id}/stats`
86-
);
87-
return response.data;
84+
const response = await this.client.get<ConversationInfo>(`/api/conversations/${this.id}`);
85+
return response.data.stats;
8886
}
8987

9088
async sendMessage(message: string | Message): Promise<void> {
@@ -104,7 +102,7 @@ export class RemoteConversation {
104102
};
105103
}
106104

107-
await this.client.post(`/api/conversations/${this.id}/send_message`, messageContent);
105+
await this.client.post(`/api/conversations/${this.id}/events`, messageContent);
108106
}
109107

110108
async run(): Promise<void> {
@@ -116,12 +114,12 @@ export class RemoteConversation {
116114
}
117115

118116
async setConfirmationPolicy(policy: ConfirmationPolicyBase): Promise<void> {
119-
await this.client.post(`/api/conversations/${this.id}/set_confirmation_policy`, policy);
117+
await this.client.post(`/api/conversations/${this.id}/confirmation_policy`, policy);
120118
}
121119

122120
async sendConfirmationResponse(accept: boolean, reason?: string): Promise<void> {
123121
const request: ConfirmationResponseRequest = { accept, reason };
124-
await this.client.post(`/api/conversations/${this.id}/send_confirmation_response`, request);
122+
await this.client.post(`/api/conversations/${this.id}/events/respond_to_confirmation`, request);
125123
}
126124

127125
async generateTitle(maxLength: number = 50, llm?: any): Promise<string> {
@@ -145,7 +143,7 @@ export class RemoteConversation {
145143
}
146144

147145
const request: UpdateSecretsRequest = { secrets: secretStrings };
148-
await this.client.post(`/api/conversations/${this.id}/update_secrets`, request);
146+
await this.client.post(`/api/conversations/${this.id}/secrets`, request);
149147
}
150148

151149
async startWebSocketClient(): Promise<void> {

0 commit comments

Comments
 (0)