Skip to content

Commit

Permalink
fixed streamlit app for new updates
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Oct 16, 2024
1 parent 55fc598 commit 8161c48
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions examples/chat/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,19 @@
"style": {"bottom": "calc(50% - 4.25rem", "right": "0.4rem"},
}
# set artifacts remote_path to WORKSPACE
artifacts = va.tools.meta_tools.Artifacts(WORKSPACE / "artifacts.pkl")
local_artifacts_path = "artifacts.pkl"
remote_artifacts_path = WORKSPACE / "artifacts.pkl"
artifacts = va.tools.meta_tools.Artifacts(remote_artifacts_path, local_artifacts_path)
if Path("artifacts.pkl").exists():
artifacts.load("artifacts.pkl")
else:
artifacts.save("artifacts.pkl")

agent = va.agent.VisionAgent(verbosity=1, local_artifacts_path="artifacts.pkl")
agent = va.agent.VisionAgent(
verbosity=2,
local_artifacts_path=local_artifacts_path,
remote_artifacts_path=remote_artifacts_path,
)

st.set_page_config(layout="wide")

Expand All @@ -54,7 +60,9 @@ def update_messages(messages, lock):
with lock:
if Path("artifacts.pkl").exists():
artifacts.load("artifacts.pkl")
new_chat, _ = agent.chat_with_artifacts(messages, artifacts=artifacts)
new_chat, _ = agent.chat_with_artifacts(
messages, artifacts=artifacts, test_multi_plan=False
)
for new_message in new_chat[len(messages) :]:
messages.append(new_message)

Expand Down

0 comments on commit 8161c48

Please sign in to comment.