mirror of
https://github.com/temporal-community/temporal-ai-agent.git
synced 2026-03-15 22:18:09 +01:00
start prompt comes from back-end
This commit is contained in:
@@ -167,7 +167,7 @@ export default function App() {
|
||||
try {
|
||||
setError(INITIAL_ERROR_STATE);
|
||||
setLoading(true);
|
||||
await apiService.sendMessage("I'd like to travel for an event.");
|
||||
await apiService.startWorkflow();
|
||||
setConversation([]);
|
||||
setLastMessage(null);
|
||||
} catch (err) {
|
||||
|
||||
@@ -56,6 +56,26 @@ export const apiService = {
|
||||
}
|
||||
},
|
||||
|
||||
async startWorkflow() {
|
||||
try {
|
||||
const res = await fetch(
|
||||
`${API_BASE_URL}/start-workflow`,
|
||||
{
|
||||
method: 'POST',
|
||||
headers: {
|
||||
'Content-Type': 'application/json'
|
||||
}
|
||||
}
|
||||
);
|
||||
return handleResponse(res);
|
||||
} catch (error) {
|
||||
throw new ApiError(
|
||||
'Failed to start workflow',
|
||||
error.status || 500
|
||||
);
|
||||
}
|
||||
},
|
||||
|
||||
async confirm() {
|
||||
try {
|
||||
const res = await fetch(`${API_BASE_URL}/confirm`, {
|
||||
|
||||
Reference in New Issue
Block a user