Spaces:
Runtime error
Runtime error
Shroominic
commited on
Commit
·
56a63a1
1
Parent(s):
6e4e48e
response methods
Browse files
codeinterpreterapi/schema/response.py
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from langchain.schema import HumanMessage, AIMessage # type: ignore
|
| 2 |
+
from .file import File
|
| 3 |
+
|
| 4 |
+
|
| 5 |
+
class UserRequest(HumanMessage):
|
| 6 |
+
files: list[File] = []
|
| 7 |
+
|
| 8 |
+
def __str__(self):
|
| 9 |
+
return self.content
|
| 10 |
+
|
| 11 |
+
def __repr__(self):
|
| 12 |
+
return f"UserRequest(content={self.content}, files={self.files})"
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class CodeInterpreterResponse(AIMessage):
|
| 16 |
+
files: list[File] = []
|
| 17 |
+
# final_code: str = "" TODO: implement
|
| 18 |
+
# final_output: str = "" TODO: implement
|
| 19 |
+
|
| 20 |
+
def __str__(self):
|
| 21 |
+
return self.content
|
| 22 |
+
|
| 23 |
+
def __repr__(self):
|
| 24 |
+
return f"CodeInterpreterResponse(content={self.content}, files={self.files})"
|