(
id: string,
type: 'client' | 'server',
label: string,
)
| 417 | } |
| 418 | |
| 419 | function getOrCreateConversation( |
| 420 | id: string, |
| 421 | type: 'client' | 'server', |
| 422 | label: string, |
| 423 | ): void { |
| 424 | if (!state.conversations[id]) { |
| 425 | setState('conversations', id, { |
| 426 | id, |
| 427 | type, |
| 428 | label, |
| 429 | messages: [], |
| 430 | chunks: [], |
| 431 | iterations: [], |
| 432 | imageEvents: [], |
| 433 | audioEvents: [], |
| 434 | speechEvents: [], |
| 435 | transcriptionEvents: [], |
| 436 | videoEvents: [], |
| 437 | status: 'active', |
| 438 | startedAt: Date.now(), |
| 439 | }) |
| 440 | if (!state.activeConversationId) { |
| 441 | setState('activeConversationId', id) |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | function attachRunToConversation( |
| 447 | conversationId: string, |
no test coverage detected