|
21 | 21 |
|
22 | 22 | from hiagent_api.base import AppAPIMixin, Service |
23 | 23 | from hiagent_api.chat_types import ( |
| 24 | + AgentErrorChatEvent, |
24 | 25 | AgentIntentionChatEvent, |
25 | 26 | AgentJumpChatEvent, |
26 | 27 | AgentTakeOverChatEvent, |
27 | 28 | AgentThoughtChatEvent, |
28 | 29 | AgentThoughtEndChatEvent, |
29 | 30 | AgentThoughtUpdateChatEvent, |
| 31 | + AsyncResumeAppWorkflowRequest, |
| 32 | + AsyncResumeAppWorkflowResponse, |
30 | 33 | BlockingChatResponse, |
| 34 | + CancelConversationTopRequest, |
| 35 | + ChatAgainRequest, |
| 36 | + ChatContinueRequest, |
31 | 37 | ChatEvent, |
32 | 38 | ChatRequest, |
| 39 | + ClearLongMemoryRequest, |
| 40 | + ClearMessageRequest, |
33 | 41 | CreateConversationRequest, |
34 | 42 | CreateConversationResponse, |
| 43 | + DeepSearchExtractionChatEvent, |
| 44 | + DeepSearchExtractionEndChatEvent, |
| 45 | + DeepSearchExtractionStartChatEvent, |
| 46 | + DeepSearchQueryChatEvent, |
| 47 | + DeepSearchQueryEndChatEvent, |
| 48 | + DeepSearchQueryStartChatEvent, |
| 49 | + DeepSearchThinkChatEvent, |
| 50 | + DeepSearchThinkEndChatEvent, |
| 51 | + DeepSearchThinkStartChatEvent, |
| 52 | + DeleteConversationRequest, |
| 53 | + DeleteLongMemoryRequest, |
| 54 | + DeleteMessageRequest, |
| 55 | + EmptyResponse, |
| 56 | + EventTriggerWebhookResponse, |
| 57 | + FeedbackRequest, |
| 58 | + FlowCostWorkflowEvent, |
| 59 | + FlowEndChatEvent, |
| 60 | + FlowEndWorkflowEvent, |
| 61 | + FlowErrorWorkflowEvent, |
| 62 | + FlowInterruptedWorkflowEvent, |
| 63 | + FlowStartChatEvent, |
| 64 | + FlowStartWorkflowEvent, |
35 | 65 | GetAppConfigPreviewRequest, |
36 | 66 | GetAppConfigPreviewResponse, |
| 67 | + GetAppUserVariablesRequest, |
| 68 | + GetAppUserVariablesResponse, |
| 69 | + GetConversationInputsRequest, |
| 70 | + GetConversationInputsResponse, |
| 71 | + GetConversationListRequest, |
| 72 | + GetConversationListResponse, |
| 73 | + GetConversationMessageRequest, |
| 74 | + GetConversationMessageResponse, |
| 75 | + GetMessageInfoRequest, |
| 76 | + GetMessageInfoResponse, |
| 77 | + GetSuggestedQuestionsRequest, |
| 78 | + GetSuggestedQuestionsResponse, |
37 | 79 | InterruptedChatEvent, |
38 | 80 | KnowledgeGraphRetrieveChatEvent, |
39 | 81 | KnowledgeGraphRetrieveEndChatEvent, |
40 | 82 | KnowledgeRetrieveChatEvent, |
41 | 83 | KnowledgeRetrieveEndChatEvent, |
| 84 | + ListLongMemoryRequest, |
| 85 | + ListLongMemoryResponse, |
| 86 | + ListOauth2TokenRequest, |
| 87 | + ListOauth2TokenResponse, |
42 | 88 | LongTermMemoryRetrieveChatEvent, |
43 | 89 | LongTermMemoryRetrieveEndChatEvent, |
44 | 90 | MessageChatEvent, |
45 | 91 | MessageCostChatEvent, |
46 | 92 | MessageEndChatEvent, |
47 | 93 | MessageFailedChatEvent, |
48 | 94 | MessageOutputEndChatEvent, |
| 95 | + MessageOutputEndWorkflowEvent, |
49 | 96 | MessageOutputStartChatEvent, |
| 97 | + MessageOutputStartWorkflowEvent, |
50 | 98 | MessageStartChatEvent, |
| 99 | + MessageWorkflowEvent, |
51 | 100 | QARetrieveChatEvent, |
| 101 | + QueryAppSkillAsyncTaskRequest, |
| 102 | + QueryAppSkillAsyncTaskResponse, |
| 103 | + QueryRunAppProcessRequest, |
| 104 | + QueryRunAppProcessResponse, |
| 105 | + QueryTriggerRunRecordsRequest, |
| 106 | + QueryTriggerRunRecordsResponse, |
| 107 | + RunAppWorkflowRequest, |
| 108 | + RunAppWorkflowResponse, |
| 109 | + SetAppUserVariablesRequest, |
| 110 | + SetConversationTopRequest, |
| 111 | + SetMessageAnswerUsedRequest, |
| 112 | + StopMessageRequest, |
52 | 113 | StreamingChatEventType, |
| 114 | + StreamingWorkflowEventType, |
53 | 115 | SuggestionChatEvent, |
54 | 116 | SuggestionCostChatEvent, |
| 117 | + SyncResumeAppWorkflowRequest, |
| 118 | + SyncResumeAppWorkflowResponse, |
| 119 | + SyncRunAppWorkflowRequest, |
| 120 | + SyncRunAppWorkflowResponse, |
55 | 121 | TerminologyRetrieveChatEvent, |
56 | 122 | TerminologyRetrieveEndChatEvent, |
57 | 123 | ThinkMessageChatEvent, |
58 | 124 | ThinkMessageOutputEndChatEvent, |
59 | 125 | ThinkMessageOutputStartChatEvent, |
60 | 126 | ToolMessageChatEvent, |
61 | 127 | ToolMessageOutputEndChatEvent, |
| 128 | + ToolMessageOutputEndWorkflowEvent, |
62 | 129 | ToolMessageOutputStartChatEvent, |
63 | | - ChatAgainRequest, GetConversationListRequest, GetConversationListResponse, GetConversationInputsRequest, |
64 | | - GetConversationInputsResponse, UpdateConversationRequest, EmptyResponse, DeleteConversationRequest, |
65 | | - StopMessageRequest, ClearMessageRequest, GetConversationMessageRequest, GetConversationMessageResponse, |
66 | | - GetMessageInfoRequest, GetMessageInfoResponse, DeleteMessageRequest, FeedbackRequest, SetMessageAnswerUsedRequest, |
67 | | - GetSuggestedQuestionsRequest, GetSuggestedQuestionsResponse, RunAppWorkflowRequest, RunAppWorkflowResponse, |
68 | | - SyncRunAppWorkflowRequest, SyncRunAppWorkflowResponse, QueryRunAppProcessRequest, QueryRunAppProcessResponse, |
69 | | - ListOauth2TokenRequest, ListOauth2TokenResponse, EventTriggerWebhookResponse, ChatContinueRequest, |
70 | | - ListLongMemoryRequest, ListLongMemoryResponse, UpdateLongMemoryRequest, DeleteLongMemoryRequest, |
71 | | - ClearLongMemoryRequest, AsyncResumeAppWorkflowRequest, AsyncResumeAppWorkflowResponse, SetConversationTopRequest, |
72 | | - CancelConversationTopRequest, QueryAppSkillAsyncTaskRequest, QueryAppSkillAsyncTaskResponse, |
73 | | - SyncResumeAppWorkflowRequest, SyncResumeAppWorkflowResponse, WorkflowEvent, StreamingWorkflowEventType, |
74 | | - FlowStartWorkflowEvent, FlowEndWorkflowEvent, FlowErrorWorkflowEvent, ToolMessageOutputEndWorkflowEvent, |
75 | | - ToolMessageOutputStartWorkflowEvent, ToolMessageWorkflowEvent, FlowCostWorkflowEvent, FlowInterruptedWorkflowEvent, |
76 | | - MessageOutputStartWorkflowEvent, MessageOutputEndWorkflowEvent, MessageWorkflowEvent, GetAppUserVariablesRequest, |
77 | | - GetAppUserVariablesResponse, SetAppUserVariablesRequest, QueryTriggerRunRecordsRequest, |
78 | | - QueryTriggerRunRecordsResponse, |
| 130 | + ToolMessageOutputStartWorkflowEvent, |
| 131 | + ToolMessageWorkflowEvent, |
| 132 | + UpdateConversationRequest, |
| 133 | + UpdateLongMemoryRequest, |
| 134 | + WorkflowEvent, |
79 | 135 | ) |
80 | 136 |
|
81 | 137 |
|
@@ -916,6 +972,30 @@ def parse_chat_event(event_data: dict) -> Optional[ChatEvent]: |
916 | 972 | return ThinkMessageOutputEndChatEvent.model_validate(event_data) |
917 | 973 | case StreamingChatEventType.think_message: |
918 | 974 | return ThinkMessageChatEvent.model_validate(event_data) |
| 975 | + case StreamingChatEventType.agent_error: |
| 976 | + return AgentErrorChatEvent.model_validate(event_data) |
| 977 | + case StreamingChatEventType.deep_search_think_start: |
| 978 | + return DeepSearchThinkStartChatEvent.model_validate(event_data) |
| 979 | + case StreamingChatEventType.deep_search_think_end: |
| 980 | + return DeepSearchThinkEndChatEvent.model_validate(event_data) |
| 981 | + case StreamingChatEventType.deep_search_think: |
| 982 | + return DeepSearchThinkChatEvent.model_validate(event_data) |
| 983 | + case StreamingChatEventType.deep_search_query_start: |
| 984 | + return DeepSearchQueryStartChatEvent.model_validate(event_data) |
| 985 | + case StreamingChatEventType.deep_search_query_end: |
| 986 | + return DeepSearchQueryEndChatEvent.model_validate(event_data) |
| 987 | + case StreamingChatEventType.deep_search_query: |
| 988 | + return DeepSearchQueryChatEvent.model_validate(event_data) |
| 989 | + case StreamingChatEventType.deep_search_extraction_start: |
| 990 | + return DeepSearchExtractionStartChatEvent.model_validate(event_data) |
| 991 | + case StreamingChatEventType.deep_search_extraction_end: |
| 992 | + return DeepSearchExtractionEndChatEvent.model_validate(event_data) |
| 993 | + case StreamingChatEventType.deep_search_extraction: |
| 994 | + return DeepSearchExtractionChatEvent.model_validate(event_data) |
| 995 | + case StreamingChatEventType.flow_start: |
| 996 | + return FlowStartChatEvent.model_validate(event_data) |
| 997 | + case StreamingChatEventType.flow_end: |
| 998 | + return FlowEndChatEvent.model_validate(event_data) |
919 | 999 |
|
920 | 1000 | return None |
921 | 1001 |
|
|
0 commit comments