Spaces:
Running
on
Zero
Running
on
Zero
df
Browse files
{routers/gra_01_chat → mysite/interpreter}/__init__.py
RENAMED
File without changes
|
mysite/interpreter/interpreter.py
CHANGED
@@ -100,3 +100,15 @@ async def completion(message: str, history, c=None, d=None, prompt="あなたは
|
|
100 |
except StopAsyncIteration:
|
101 |
return
|
102 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
100 |
except StopAsyncIteration:
|
101 |
return
|
102 |
|
103 |
+
# 例としての使用方法
|
104 |
+
if __name__ == "__main__":
|
105 |
+
history = [
|
106 |
+
("user message 1", "assistant response 1"),
|
107 |
+
("user message 2", "assistant response 2"),
|
108 |
+
]
|
109 |
+
|
110 |
+
async def main():
|
111 |
+
async for response in completion("新しいメッセージ", history):
|
112 |
+
print(response)
|
113 |
+
|
114 |
+
asyncio.run(main())
|
routers/gra_01_chat/__inits__.py
ADDED
File without changes
|