starsnatched commited on
Commit
a74f4b0
·
1 Parent(s): 9e68ce9

Add test file and update document upload logic in run.py

Browse files
Files changed (3) hide show
  1. .gitignore +3 -0
  2. run.py +3 -2
  3. test.txt +4 -0
.gitignore CHANGED
@@ -26,6 +26,9 @@ share/python-wheels/
26
  *.egg
27
  MANIFEST
28
 
 
 
 
29
  # PyInstaller
30
  # Usually these files are written by a python script from a template
31
  # before PyInstaller builds the exe, so as to inject date/other infos into it.
 
26
  *.egg
27
  MANIFEST
28
 
29
+ # Documents
30
+ uploads/
31
+
32
  # PyInstaller
33
  # Usually these files are written by a python script from a template
34
  # before PyInstaller builds the exe, so as to inject date/other infos into it.
run.py CHANGED
@@ -7,8 +7,9 @@ from src.chat import ChatSession
7
 
8
  async def _main() -> None:
9
  async with ChatSession(user="demo_user", session="demo_session") as chat:
10
- doc_path = chat.upload_document("README.md")
11
- answer = await chat.chat(f"List the first three lines of {doc_path}")
 
12
  print("\n>>>", answer)
13
 
14
 
 
7
 
8
  async def _main() -> None:
9
  async with ChatSession(user="demo_user", session="demo_session") as chat:
10
+ doc_path = chat.upload_document("test.txt")
11
+ print(f"Document uploaded to VM at: {doc_path}")
12
+ answer = await chat.chat(f"What's in {doc_path}?")
13
  print("\n>>>", answer)
14
 
15
 
test.txt ADDED
@@ -0,0 +1,4 @@
 
 
 
 
 
1
+ This is a test file.
2
+ Blah blah blah.
3
+ Hello, world!
4
+ Python is awesome!