Initial commit
This commit is contained in:
@@ -0,0 +1,25 @@
|
||||
import { request } from './client';
|
||||
import type { TeacherResponse } from './types';
|
||||
|
||||
export type ConversationResponse = {
|
||||
session?: { id: string };
|
||||
turn?: { text: string };
|
||||
user_turn?: { text: string };
|
||||
teacher_turn?: { text: string };
|
||||
teacher: TeacherResponse;
|
||||
audio?: { mime_type: string; base64: string } | null;
|
||||
};
|
||||
|
||||
export function startConversation() {
|
||||
return request<ConversationResponse>('/conversation/start', {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({})
|
||||
});
|
||||
}
|
||||
|
||||
export function sendConversationTurn(sessionId: string, text: string) {
|
||||
return request<ConversationResponse>(`/conversation/${sessionId}/turn`, {
|
||||
method: 'POST',
|
||||
body: JSON.stringify({ text })
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user