Niansuh commited on
Commit
b1161c6
·
verified ·
1 Parent(s): 38f655c

Update main.py

Browse files
Files changed (1) hide show
  1. main.py +39 -39
main.py CHANGED
@@ -162,45 +162,45 @@ async def chat_completions(
162
  original_uuid = uuid.uuid4()
163
  uuid_str = str(original_uuid).replace("-", "")
164
 
165
- # Using the OpenAI API
166
- json_data = {
167
- 'prompt': "\n".join(
168
- [
169
- f"{'User' if msg.role == 'user' else 'Assistant'}: {msg.content}"
170
- for msg in request.messages
171
- ]
172
- ),
173
- 'stream': True,
174
- 'app_name': 'ChitChat_Chrome_Ext',
175
- 'app_version': '4.28.0',
176
- 'tz_name': 'Asia/Karachi',
177
- 'cid': 'C092SEMXM9BJ',
178
- 'model': request.model,
179
- 'search': False,
180
- 'auto_search': False,
181
- 'filter_search_history': False,
182
- 'from': 'chat',
183
- 'group_id': 'default',
184
- 'chat_models': [],
185
- 'files': [],
186
- 'prompt_template': {
187
- 'key': 'artifacts',
188
- 'attributes': {
189
- 'lang': 'original',
190
- },
191
- },
192
- 'tools': {
193
- 'auto': [
194
- 'search',
195
- 'text_to_image',
196
- 'data_analysis',
197
- ],
198
- },
199
- 'extra_info': {
200
- 'origin_url': 'chrome-extension://difoiogjjojoaoomphldepapgpbgkhkb/standalone.html?from=sidebar',
201
- 'origin_title': 'Sider',
202
- },
203
- }
204
 
205
  async def generate():
206
  async with httpx.AsyncClient() as client:
 
162
  original_uuid = uuid.uuid4()
163
  uuid_str = str(original_uuid).replace("-", "")
164
 
165
+ # Using the OpenAI API
166
+ json_data = {
167
+ 'prompt': "\n".join(
168
+ [
169
+ f"{'User' if msg.role == 'user' else 'Assistant'}: {msg.content}"
170
+ for msg in request.messages
171
+ ]
172
+ ),
173
+ 'stream': True,
174
+ 'app_name': 'ChitChat_Edge_Ext',
175
+ 'app_version': '4.28.0',
176
+ 'tz_name': 'Asia/Karachi',
177
+ 'cid': 'C092SEMXM9BJ',
178
+ 'model': request.model,
179
+ 'search': False,
180
+ 'auto_search': False,
181
+ 'filter_search_history': False,
182
+ 'from': 'chat',
183
+ 'group_id': 'default',
184
+ 'chat_models': [],
185
+ 'files': [],
186
+ 'prompt_template': {
187
+ 'key': '',
188
+ 'attributes': {
189
+ 'lang': 'original',
190
+ },
191
+ },
192
+ 'tools': {
193
+ 'auto': [
194
+ 'search',
195
+ 'text_to_image',
196
+ 'data_analysis',
197
+ ],
198
+ },
199
+ 'extra_info': {
200
+ 'origin_url': '',
201
+ 'origin_title': '',
202
+ },
203
+ }
204
 
205
  async def generate():
206
  async with httpx.AsyncClient() as client: