Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: change logs to log #182

Merged
merged 2 commits into from
Jul 26, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 10 additions & 10 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ def pick_plan(
k = list(plans.keys())[0]
log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Plans created",
"status": "completed",
"payload": plans[k],
Expand All @@ -194,7 +194,7 @@ def pick_plan(

log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Generating code to pick best plan",
"status": "started",
}
Expand All @@ -212,7 +212,7 @@ def pick_plan(
code = extract_code(model(prompt))
log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Executing code to test plan",
"code": code,
"status": "running",
Expand All @@ -229,7 +229,7 @@ def pick_plan(

log_progress(
{
"type": "logs",
"type": "log",
"log_content": (
"Code execution succeed"
if tool_output.success
Expand All @@ -251,7 +251,7 @@ def pick_plan(
)
log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Retry running code",
"code": code,
"status": "running",
Expand All @@ -263,7 +263,7 @@ def pick_plan(
)
log_progress(
{
"type": "logs",
"type": "log",
"log_content": (
"Code execution succeed"
if tool_output.success
Expand Down Expand Up @@ -318,7 +318,7 @@ def pick_plan(

log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Picked best plan",
"status": "complete",
"payload": best_plans,
Expand Down Expand Up @@ -771,7 +771,7 @@ def chat_with_workflow(

self.log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Creating plans",
"status": "started",
}
Expand All @@ -798,7 +798,7 @@ def chat_with_workflow(
if test_multi_plan:
self.log_progress(
{
"type": "logs",
"type": "log",
"log_content": "Creating plans",
"status": "completed",
"payload": tool_lists,
Expand Down Expand Up @@ -846,8 +846,8 @@ def chat_with_workflow(
{
"type": "final_code",
"status": "completed" if success else "failed",
"code": DefaultImports.prepend_imports(code),
"payload": {
"code": DefaultImports.prepend_imports(code),
"test": test,
"result": execution_result.to_json(),
},
Expand Down
Loading