|
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, |
| 130 | + ToolMessageOutputStartWorkflowEvent, |
| 131 | + ToolMessageWorkflowEvent, |
| 132 | + UpdateConversationRequest, |
| 133 | + UpdateLongMemoryRequest, |
| 134 | + WorkflowEvent, |
63 | 135 | ChatAgainRequest, GetConversationListRequest, GetConversationListResponse, GetConversationInputsRequest, |
64 | 136 | GetConversationInputsResponse, UpdateConversationRequest, EmptyResponse, DeleteConversationRequest, |
65 | 137 | StopMessageRequest, ClearMessageRequest, GetConversationMessageRequest, GetConversationMessageResponse, |
@@ -957,6 +1029,30 @@ def parse_chat_event(event_data: dict) -> Optional[ChatEvent]: |
957 | 1029 | return ThinkMessageOutputEndChatEvent.model_validate(event_data) |
958 | 1030 | case StreamingChatEventType.think_message: |
959 | 1031 | return ThinkMessageChatEvent.model_validate(event_data) |
| 1032 | + case StreamingChatEventType.agent_error: |
| 1033 | + return AgentErrorChatEvent.model_validate(event_data) |
| 1034 | + case StreamingChatEventType.deep_search_think_start: |
| 1035 | + return DeepSearchThinkStartChatEvent.model_validate(event_data) |
| 1036 | + case StreamingChatEventType.deep_search_think_end: |
| 1037 | + return DeepSearchThinkEndChatEvent.model_validate(event_data) |
| 1038 | + case StreamingChatEventType.deep_search_think: |
| 1039 | + return DeepSearchThinkChatEvent.model_validate(event_data) |
| 1040 | + case StreamingChatEventType.deep_search_query_start: |
| 1041 | + return DeepSearchQueryStartChatEvent.model_validate(event_data) |
| 1042 | + case StreamingChatEventType.deep_search_query_end: |
| 1043 | + return DeepSearchQueryEndChatEvent.model_validate(event_data) |
| 1044 | + case StreamingChatEventType.deep_search_query: |
| 1045 | + return DeepSearchQueryChatEvent.model_validate(event_data) |
| 1046 | + case StreamingChatEventType.deep_search_extraction_start: |
| 1047 | + return DeepSearchExtractionStartChatEvent.model_validate(event_data) |
| 1048 | + case StreamingChatEventType.deep_search_extraction_end: |
| 1049 | + return DeepSearchExtractionEndChatEvent.model_validate(event_data) |
| 1050 | + case StreamingChatEventType.deep_search_extraction: |
| 1051 | + return DeepSearchExtractionChatEvent.model_validate(event_data) |
| 1052 | + case StreamingChatEventType.flow_start: |
| 1053 | + return FlowStartChatEvent.model_validate(event_data) |
| 1054 | + case StreamingChatEventType.flow_end: |
| 1055 | + return FlowEndChatEvent.model_validate(event_data) |
960 | 1056 |
|
961 | 1057 | return None |
962 | 1058 |
|
|
0 commit comments