Skip to content

Commit

Permalink
v2.3.47
Browse files Browse the repository at this point in the history
  • Loading branch information
ashpreetbedi committed Feb 28, 2024
1 parent f611ebd commit 271dc66
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 11 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,7 @@ venv*
phienv*
aienv*

# ignore scratch dir
scratch

.ipynb_checkpoints
16 changes: 7 additions & 9 deletions phi/llm/ollama/chat.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

class Ollama(LLM):
name: str = "Ollama"
model: str = "llama2"
model: str = "openhermes"
host: Optional[str] = None
timeout: Optional[Any] = None
format: Optional[str] = None
Expand Down Expand Up @@ -143,10 +143,9 @@ def response(self, messages: List[Message]) -> str:
for tool_call in assistant_tool_calls:
tool_call_name = tool_call.get("name")
tool_call_args = tool_call.get("arguments")
_function_def = {
"name": tool_call_name,
"arguments": json.dumps(tool_call_args),
}
_function_def = {"name": tool_call_name}
if tool_call_args is not None:
_function_def["arguments"] = json.dumps(tool_call_args)
tool_calls.append(
{
"type": "function",
Expand Down Expand Up @@ -291,10 +290,9 @@ def response_stream(self, messages: List[Message]) -> Iterator[str]:
for tool_call in assistant_tool_calls:
tool_call_name = tool_call.get("name")
tool_call_args = tool_call.get("arguments")
_function_def = {
"name": tool_call_name,
"arguments": json.dumps(tool_call_args),
}
_function_def = {"name": tool_call_name}
if tool_call_args is not None:
_function_def["arguments"] = json.dumps(tool_call_args)
tool_calls.append(
{
"type": "function",
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "phidata"
version = "2.3.46"
version = "2.3.47"
description = "Build AI Assistants using function calling"
requires-python = ">=3.8"
readme = "README.md"
Expand Down Expand Up @@ -71,7 +71,7 @@ check_untyped_defs = true
no_implicit_optional = true
warn_unused_configs = true
plugins = ["pydantic.mypy"]
exclude = ["phienv*", "aienv*"]
exclude = ["phienv*", "aienv*", "scratch*"]

[[tool.mypy.overrides]]
module = [
Expand Down

0 comments on commit 271dc66

Please sign in to comment.