Skip to content

Commit

Permalink
reverted model name param
Browse files Browse the repository at this point in the history
  • Loading branch information
Avi-Robusta committed Dec 22, 2024
1 parent dbab2c7 commit 54aa2ba
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion holmes/core/tool_calling_llm.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ def call(
) -> LLMResult:

tool_calls = []
tools = self.tool_executor.get_all_tools_openai_format(self.llm.model)
tools = self.tool_executor.get_all_tools_openai_format()
for i in range(self.max_steps):
logging.debug(f"running iteration {i}")
# on the last step we don't allow tools - we want to force a reply, not a request to run another tool
Expand Down
8 changes: 4 additions & 4 deletions holmes/core/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ class Tool(ABC, BaseModel):
)
additional_instructions: Optional[str] = None

def get_openai_format(self, model: Optional[str]):
def get_openai_format(self):
tool_properties = {}
for param_name, param_attributes in self.parameters.items():
tool_properties[param_name] = {"type": param_attributes.type}
Expand All @@ -105,7 +105,7 @@ def get_openai_format(self, model: Optional[str]):
}

# gemini doesnt have parameters object if it is without params
if "gemini" in model and tool_properties is None:
if tool_properties is None:
result["function"].pop("parameters")

return result
Expand Down Expand Up @@ -393,8 +393,8 @@ def get_tool_by_name(self, name: str) -> Optional[YAMLTool]:
logging.warning(f"could not find tool {name}. skipping")
return None

def get_all_tools_openai_format(self, model: Optional[str]):
return [tool.get_openai_format(model) for tool in self.tools_by_name.values()]
def get_all_tools_openai_format(self):
return [tool.get_openai_format() for tool in self.tools_by_name.values()]

class ToolsetYamlFromConfig(Toolset):
name: str
Expand Down

0 comments on commit 54aa2ba

Please sign in to comment.