|
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 | + GetOpeningConfigOpenRequest, |
| 78 | + GetOpeningConfigOpenResponse, |
| 79 | + GetSuggestedQuestionsRequest, |
| 80 | + GetSuggestedQuestionsResponse, |
37 | 81 | InterruptedChatEvent, |
38 | 82 | KnowledgeGraphRetrieveChatEvent, |
39 | 83 | KnowledgeGraphRetrieveEndChatEvent, |
40 | 84 | KnowledgeRetrieveChatEvent, |
41 | 85 | KnowledgeRetrieveEndChatEvent, |
| 86 | + ListLongMemoryRequest, |
| 87 | + ListLongMemoryResponse, |
| 88 | + ListOauth2TokenRequest, |
| 89 | + ListOauth2TokenResponse, |
42 | 90 | LongTermMemoryRetrieveChatEvent, |
43 | 91 | LongTermMemoryRetrieveEndChatEvent, |
44 | 92 | MessageChatEvent, |
45 | 93 | MessageCostChatEvent, |
46 | 94 | MessageEndChatEvent, |
47 | 95 | MessageFailedChatEvent, |
48 | 96 | MessageOutputEndChatEvent, |
| 97 | + MessageOutputEndWorkflowEvent, |
49 | 98 | MessageOutputStartChatEvent, |
| 99 | + MessageOutputStartWorkflowEvent, |
50 | 100 | MessageStartChatEvent, |
| 101 | + MessageWorkflowEvent, |
51 | 102 | QARetrieveChatEvent, |
| 103 | + QueryAppMessageOauthStatusOpenRequest, |
| 104 | + QueryAppMessageOauthStatusResponse, |
| 105 | + QueryAppSkillAsyncTaskRequest, |
| 106 | + QueryAppSkillAsyncTaskResponse, |
| 107 | + QueryRunAppProcessRequest, |
| 108 | + QueryRunAppProcessResponse, |
| 109 | + QueryTriggerRunRecordsRequest, |
| 110 | + QueryTriggerRunRecordsResponse, |
| 111 | + RunAppWorkflowRequest, |
| 112 | + RunAppWorkflowResponse, |
| 113 | + SetAppUserVariablesRequest, |
| 114 | + SetConversationTopRequest, |
| 115 | + SetMessageAnswerUsedRequest, |
| 116 | + StopMessageRequest, |
52 | 117 | StreamingChatEventType, |
| 118 | + StreamingWorkflowEventType, |
53 | 119 | SuggestionChatEvent, |
54 | 120 | SuggestionCostChatEvent, |
| 121 | + SyncResumeAppWorkflowRequest, |
| 122 | + SyncResumeAppWorkflowResponse, |
| 123 | + SyncRunAppWorkflowRequest, |
| 124 | + SyncRunAppWorkflowResponse, |
55 | 125 | TerminologyRetrieveChatEvent, |
56 | 126 | TerminologyRetrieveEndChatEvent, |
57 | 127 | ThinkMessageChatEvent, |
58 | 128 | ThinkMessageOutputEndChatEvent, |
59 | 129 | ThinkMessageOutputStartChatEvent, |
60 | 130 | ToolMessageChatEvent, |
61 | 131 | ToolMessageOutputEndChatEvent, |
| 132 | + ToolMessageOutputEndWorkflowEvent, |
62 | 133 | 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, GetOpeningConfigOpenRequest, GetOpeningConfigOpenResponse, |
79 | | - QueryAppMessageOauthStatusOpenRequest, QueryAppMessageOauthStatusResponse |
| 134 | + ToolMessageOutputStartWorkflowEvent, |
| 135 | + ToolMessageWorkflowEvent, |
| 136 | + UpdateConversationRequest, |
| 137 | + UpdateLongMemoryRequest, |
| 138 | + WorkflowEvent, |
80 | 139 | ) |
81 | 140 |
|
82 | 141 |
|
@@ -957,6 +1016,30 @@ def parse_chat_event(event_data: dict) -> Optional[ChatEvent]: |
957 | 1016 | return ThinkMessageOutputEndChatEvent.model_validate(event_data) |
958 | 1017 | case StreamingChatEventType.think_message: |
959 | 1018 | return ThinkMessageChatEvent.model_validate(event_data) |
| 1019 | + case StreamingChatEventType.agent_error: |
| 1020 | + return AgentErrorChatEvent.model_validate(event_data) |
| 1021 | + case StreamingChatEventType.deep_search_think_start: |
| 1022 | + return DeepSearchThinkStartChatEvent.model_validate(event_data) |
| 1023 | + case StreamingChatEventType.deep_search_think_end: |
| 1024 | + return DeepSearchThinkEndChatEvent.model_validate(event_data) |
| 1025 | + case StreamingChatEventType.deep_search_think: |
| 1026 | + return DeepSearchThinkChatEvent.model_validate(event_data) |
| 1027 | + case StreamingChatEventType.deep_search_query_start: |
| 1028 | + return DeepSearchQueryStartChatEvent.model_validate(event_data) |
| 1029 | + case StreamingChatEventType.deep_search_query_end: |
| 1030 | + return DeepSearchQueryEndChatEvent.model_validate(event_data) |
| 1031 | + case StreamingChatEventType.deep_search_query: |
| 1032 | + return DeepSearchQueryChatEvent.model_validate(event_data) |
| 1033 | + case StreamingChatEventType.deep_search_extraction_start: |
| 1034 | + return DeepSearchExtractionStartChatEvent.model_validate(event_data) |
| 1035 | + case StreamingChatEventType.deep_search_extraction_end: |
| 1036 | + return DeepSearchExtractionEndChatEvent.model_validate(event_data) |
| 1037 | + case StreamingChatEventType.deep_search_extraction: |
| 1038 | + return DeepSearchExtractionChatEvent.model_validate(event_data) |
| 1039 | + case StreamingChatEventType.flow_start: |
| 1040 | + return FlowStartChatEvent.model_validate(event_data) |
| 1041 | + case StreamingChatEventType.flow_end: |
| 1042 | + return FlowEndChatEvent.model_validate(event_data) |
960 | 1043 |
|
961 | 1044 | return None |
962 | 1045 |
|
|
0 commit comments