Spaces:
Running
on
Zero
Running
on
Zero
update chunck
Browse files
chat_history.db
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
-
oid sha256:
|
3 |
-
size
|
|
|
1 |
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:e52c7021bd429aa8758ed47b7a37e236b5f24ec7a5cc48ca38cfe70f374dec75
|
3 |
+
size 1839104
|
controllers/gra_02_openInterpreter/OpenInterpreter.py
CHANGED
@@ -135,14 +135,22 @@ def chat_with_interpreter(message, history=None, a=None, b=None, c=None, d=None)
|
|
135 |
user_entry = {"role": "user", "type": "message", "content": message}
|
136 |
interpreter.messages.append(user_entry)
|
137 |
add_message_to_db("user", "message", message)
|
138 |
-
|
139 |
for chunk in interpreter.chat(message, display=False, stream=False):
|
140 |
-
if isinstance(chunk, dict):
|
141 |
-
|
142 |
-
else:
|
143 |
-
|
144 |
-
|
145 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
146 |
|
147 |
assistant_entry = {"role": "assistant", "type": "message", "content": full_response}
|
148 |
interpreter.messages.append(assistant_entry)
|
|
|
135 |
user_entry = {"role": "user", "type": "message", "content": message}
|
136 |
interpreter.messages.append(user_entry)
|
137 |
add_message_to_db("user", "message", message)
|
138 |
+
all_result = ""
|
139 |
for chunk in interpreter.chat(message, display=False, stream=False):
|
140 |
+
#if isinstance(chunk, dict):
|
141 |
+
# full_response = format_response(chunk, full_response)
|
142 |
+
#else:
|
143 |
+
# raise TypeError("Expected chunk to be a dictionary")
|
144 |
+
|
145 |
+
|
146 |
+
#print(full_response)
|
147 |
+
#yield full_response
|
148 |
+
\
|
149 |
+
#for chunk in response:
|
150 |
+
current_content = chunk.choices[0].delta.content or ""
|
151 |
+
all_result += current_content
|
152 |
+
yield current_content
|
153 |
+
yield all_result
|
154 |
|
155 |
assistant_entry = {"role": "assistant", "type": "message", "content": full_response}
|
156 |
interpreter.messages.append(assistant_entry)
|
workspace/helloworld
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
Hello, World!
|