Skip to content

Commit

Permalink
fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
dillonalaird committed Mar 19, 2024
1 parent 4f01bae commit 38f73a4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion vision_agent/agent/easytool.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ def retrieval(
tool_name = tool_instructions["name"]

parameters = choose_parameter(model, question, tool_usage, previous_log)
if parameters is None: # TODO
if parameters is None: # TODO
pass
tool_results = [{"tool_name": tool_name, "parameters": parameters}]

Expand Down Expand Up @@ -212,6 +212,7 @@ class EasyTool(Agent):
>>> print(resp)
>>> "It will travel approximately 31.03 kilometers in 29 minutes."
"""

def __init__(
self,
task_model: Optional[Union[LLM, LMM]] = None,
Expand Down
8 changes: 5 additions & 3 deletions vision_agent/llm/llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,9 @@ def __call__(self, input: Union[str, List[Dict[str, str]]]) -> str:
class OpenAILLM(LLM):
r"""An LLM class for any OpenAI LLM model."""

def __init__(self, model_name: str = "gpt-4-turbo-preview", json_mode: bool = False):
def __init__(
self, model_name: str = "gpt-4-turbo-preview", json_mode: bool = False
):
self.model_name = model_name
self.client = OpenAI()
self.json_mode = json_mode
Expand All @@ -43,7 +45,7 @@ def generate(self, prompt: str) -> str:
messages=[
{"role": "user", "content": prompt},
],
**kwargs, # type: ignore
**kwargs, # type: ignore
)

return cast(str, response.choices[0].message.content)
Expand All @@ -53,7 +55,7 @@ def chat(self, chat: List[Dict[str, str]]) -> str:
response = self.client.chat.completions.create(
model=self.model_name,
messages=chat, # type: ignore
**kwargs, # type: ignore
**kwargs, # type: ignore
)

return cast(str, response.choices[0].message.content)
Expand Down

0 comments on commit 38f73a4

Please sign in to comment.