Skip to content

Commit

Permalink
mypy, flake8 fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Jul 16, 2024
1 parent 33856a7 commit 6326e57
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 7 deletions.
10 changes: 8 additions & 2 deletions vision_agent/agent/vision_agent.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@

from vision_agent.agent import Agent
from vision_agent.agent.agent_utils import extract_json
from vision_agent.agent.vision_agent_prompts import EXAMPLES_CODE1, EXAMPLES_CODE2, VA_CODE
from vision_agent.agent.vision_agent_prompts import (
EXAMPLES_CODE1,
EXAMPLES_CODE2,
VA_CODE,
)
from vision_agent.lmm import LMM, Message, OpenAILMM
from vision_agent.tools import META_TOOL_DOCSTRING
from vision_agent.utils import CodeInterpreterFactory
Expand Down Expand Up @@ -80,7 +84,9 @@ def run_code_action(code: str, code_interpreter: CodeInterpreter) -> str:
# for log in result.logs.stderr:
# return_str += log.replace("\\n", "\n")
if result.error:
return_str += "\n" + result.error.value + "\n".join(result.error.traceback_raw)
return_str += (
"\n" + result.error.value + "\n".join(result.error.traceback_raw)
)

return return_str

Expand Down
3 changes: 2 additions & 1 deletion vision_agent/lmm/lmm.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@
import os
from abc import ABC, abstractmethod
from pathlib import Path
from typing import Any, Callable, Dict, List, Optional, Sequence, Union, cast
from typing import Any, Callable, Dict, List, Optional, Union, cast

import requests
from openai import AzureOpenAI, OpenAI
from PIL import Image

import vision_agent.tools as T
from vision_agent.tools.prompts import CHOOSE_PARAMS, SYSTEM_PROMPT

from .types import Message

_LOGGER = logging.getLogger(__name__)
Expand Down
2 changes: 1 addition & 1 deletion vision_agent/tools/meta_tools.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import subprocess
from pathlib import Path
from typing import List
from vision_agent.lmm.types import Message

import vision_agent as va
from vision_agent.lmm.types import Message
from vision_agent.tools.tool_utils import get_tool_documentation

CURRENT_FILE = None
Expand Down
6 changes: 3 additions & 3 deletions vision_agent/tools/tool_utils.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import inspect
import logging
import os
import pandas as pd
import inspect
from typing import Any, Dict, List, Callable
from typing import Any, Callable, Dict, List

import pandas as pd
from requests import Session
from requests.adapters import HTTPAdapter
from urllib3.util.retry import Retry
Expand Down

0 comments on commit 6326e57

Please sign in to comment.