22
33from thesis_py .research .events .schema .research import ResearchMode
44
5+
56# Response Models
67class ConversationCreateResponse (BaseModel ):
78 status : str = Field (
8- description = "Response status, always 'ok' for successful creation" , example = 'ok'
9+ description = "Response status, always 'ok' for successful creation" , example = "ok"
910 )
1011 conversation_id : str = Field (
11- description = ' Unique identifier for the created conversation' ,
12- example = ' conv_abc123def456' ,
12+ description = " Unique identifier for the created conversation" ,
13+ example = " conv_abc123def456" ,
1314 )
1415
16+
1517class ConversationEvent (BaseModel ):
16- action : str = Field (description = ' Type of action/event' , example = ' message' )
17- source : str = Field (description = ' Source of the event (user/agent)' , example = ' user' )
18+ action : str = Field (description = " Type of action/event" , example = " message" )
19+ source : str = Field (description = " Source of the event (user/agent)" , example = " user" )
1820 message : str = Field (
19- description = ' Content of the message or action' ,
20- example = ' Please review this code' ,
21+ description = " Content of the message or action" ,
22+ example = " Please review this code" ,
2123 )
2224 timestamp : str = Field (
23- description = ' ISO timestamp when the event occurred' ,
24- example = ' 2024-01-15T10:30:00Z' ,
25+ description = " ISO timestamp when the event occurred" ,
26+ example = " 2024-01-15T10:30:00Z" ,
2527 )
2628
2729
2830class ConversationDetailResponse (BaseModel ):
2931 conversation_id : str = Field (
30- description = ' Unique conversation identifier' , example = ' conv_abc123def456'
32+ description = " Unique conversation identifier" , example = " conv_abc123def456"
3133 )
32- title : str = Field (description = ' Conversation title' , example = ' Code Review Session' )
33- status : str = Field (description = ' Current conversation status' , example = ' RUNNING' )
34+ title : str = Field (description = " Conversation title" , example = " Code Review Session" )
35+ status : str = Field (description = " Current conversation status" , example = " RUNNING" )
3436 created_at : str = Field (
35- description = ' ISO timestamp when conversation was created' ,
36- example = ' 2024-01-15T10:30:00Z' ,
37+ description = " ISO timestamp when conversation was created" ,
38+ example = " 2024-01-15T10:30:00Z" ,
3739 )
3840 last_updated_at : str = Field (
39- description = ' ISO timestamp of last activity' , example = ' 2024-01-15T11:45:00Z'
41+ description = " ISO timestamp of last activity" , example = " 2024-01-15T11:45:00Z"
4042 )
4143 selected_repository : str | None = Field (
42- description = ' Associated repository if any' , example = ' user/project-repo'
44+ description = " Associated repository if any" , example = " user/project-repo"
4345 )
4446 research_mode : str | None = Field (
45- description = ' Research mode used in conversation' , example = ' deep_research'
47+ description = " Research mode used in conversation" , example = " deep_research"
4648 )
4749 events : list [dict ] | None = Field (
48- description = ' List of conversation events/messages' , default = None
50+ description = " List of conversation events/messages" , default = None
4951 )
5052 final_result : str | dict | None = Field (
51- description = ' Final result if conversation is completed' , default = None
53+ description = " Final result if conversation is completed" , default = None
5254 )
53-
55+
56+
5457class CreateNewConversationIntegrationRequest (BaseModel ):
5558 initial_user_msg : str | None = Field (
5659 None ,
57- description = ' Initial message to start the conversation' ,
60+ description = " Initial message to start the conversation" ,
5861 example = "What's the new DeFi meta recently that I can ape in?" ,
5962 )
6063 research_mode : ResearchMode | None = Field (
61- None , description = ' Research mode for the conversation' , example = ' deep_research'
64+ None , description = " Research mode for the conversation" , example = " deep_research"
6265 )
6366 space_id : int | None = Field (
6467 None ,
65- description = ' Your space ID. You can find it via your created space' ,
68+ description = " Your space ID. You can find it via your created space" ,
6669 example = 123 ,
6770 )
6871 space_section_id : int | None = Field (
6972 None ,
70- description = ' Your space section ID. You can find it via your created space' ,
73+ description = " Your space section ID. You can find it via your created space" ,
7174 example = 456 ,
7275 )
7376 thread_follow_up : int | None = Field (
74- None , description = ' Thread ID for follow-up conversations' , example = 789
77+ None , description = " Thread ID for follow-up conversations" , example = 789
7578 )
7679 followup_discover_id : str | None = Field (
7780 None ,
78- description = ' Discovery ID for follow-up research' ,
79- example = ' discover_abc123' ,
81+ description = " Discovery ID for follow-up research" ,
82+ example = " discover_abc123" ,
8083 )
8184 mcp_disable : dict [str , bool ] | None = Field (
8285 None ,
83- description = 'MCP tools to disable for this conversation' ,
86+ description = "MCP tools to disable for this conversation. The example has a fool list of MCP tools to disable." ,
87+ example = {
88+ "hyperwhales" : True ,
89+ "liquidity" : True ,
90+ "stable" : True ,
91+ "browser_mcp" : True ,
92+ "x_ai_search_tool" : True ,
93+ "investing_news" : True ,
94+ "jina" : True ,
95+ "arbitraging" : True ,
96+ "netlify" : True ,
97+ "meme" : True ,
98+ "perpetual_whales_analysis" : True ,
99+ "price" : True ,
100+ "defi_earn" : True ,
101+ "ratsa_signal" : True ,
102+ "astar_stable_yield" : True ,
103+ "crypto_insight_search_service" : True ,
104+ "token_metrics" : True ,
105+ },
84106 )
85107 system_prompt : str | None = Field (
86108 None ,
87- description = ' Custom system prompt to guide the AI behavior' ,
109+ description = " Custom system prompt to guide the AI behavior" ,
88110 example = "You are a DeFi gigachad who's always ahead of the new DeFi meta." ,
89111 )
90-
112+
91113 @field_serializer ("research_mode" )
92- def serialize_research_mode (self , research_mode : ResearchMode | None , _info ) -> str | None :
114+ def serialize_research_mode (
115+ self , research_mode : ResearchMode | None , _info
116+ ) -> str | None :
93117 return research_mode .value if research_mode else None
94118
119+
95120class CreateChatConversationIntegrationRequest (BaseModel ):
96121 initial_user_msg : str | None = Field (
97122 None ,
98- description = ' Initial message for the chat conversation' ,
123+ description = " Initial message for the chat conversation" ,
99124 example = "Let's have a casual conversation about DeFi" ,
100125 )
101126 system_prompt : str | None = Field (
102127 None ,
103128 description = "System prompt to set the AI's behavior in chat mode" ,
104- example = ' You are a friendly AI assistant who explains complex topics simply' ,
129+ example = " You are a friendly AI assistant who explains complex topics simply" ,
105130 )
106131
107132
108133class CreateDeepResearchConversationIntegrationRequest (BaseModel ):
109134 initial_user_msg : str | None = Field (
110135 None ,
111- description = ' Initial research query to begin deep analysis' ,
112- example = ' Research the latest developments in DeFi' ,
136+ description = " Initial research query to begin deep analysis" ,
137+ example = " Research the latest developments in DeFi" ,
113138 )
114139 mcp_disable : dict [str , bool ] | None = Field (
115140 None ,
116- description = ' MCP tools to disable during deep research' ,
141+ description = " MCP tools to disable during deep research" ,
117142 )
118143 system_prompt : str | None = Field (
119144 None ,
120- description = ' System prompt for deep research mode behavior' ,
121- example = ' You are a thorough DeFi researcher who provides comprehensive analysis with citations' ,
145+ description = " System prompt for deep research mode behavior" ,
146+ example = " You are a thorough DeFi researcher who provides comprehensive analysis with citations" ,
122147 )
123148
149+
124150class JoinConversationIntegrationRequest (BaseModel ):
125151 conversation_id : str | None = Field (
126152 None ,
127- description = ' ID of the existing conversation to join' ,
128- example = ' conv_abc123def456' ,
153+ description = " ID of the existing conversation to join" ,
154+ example = " conv_abc123def456" ,
129155 )
130156 user_prompt : str | None = Field (
131157 None ,
132- description = ' Message to send when joining the conversation' ,
133- example = ' Please review the code we discussed earlier' ,
158+ description = " Message to send when joining the conversation" ,
159+ example = " Please review the code we discussed earlier" ,
134160 )
135161 research_mode : ResearchMode | None = Field (
136162 None ,
137- description = ' Research mode to use in the conversation. Must be one of: chat, deep_research, follow_up' ,
163+ description = " Research mode to use in the conversation. Must be one of: chat, deep_research, follow_up" ,
138164 example = ResearchMode .DEEP_RESEARCH .value ,
139165 )
140166 latest_event_id : int | None = Field (
141167 None ,
142- description = ' ID of the latest event to resume from' ,
168+ description = " ID of the latest event to resume from" ,
143169 example = 123 ,
144170 )
145171 x_device_id : str | None = Field (
146172 None ,
147- description = ' Device ID to use for the conversation' ,
148- example = ' 123' ,
173+ description = " Device ID to use for the conversation" ,
174+ example = " 123" ,
149175 )
150176
151177 @field_serializer ("research_mode" )
152- def serialize_research_mode (self , research_mode : ResearchMode | None , _info ) -> str | None :
153- return research_mode .value if research_mode else None
178+ def serialize_research_mode (
179+ self , research_mode : ResearchMode | None , _info
180+ ) -> str | None :
181+ return research_mode .value if research_mode else None
0 commit comments