Skip to content

Commit

Permalink
Fixed tool_choice injection in test_sucessful_memory_agent
Browse files Browse the repository at this point in the history
  • Loading branch information
maykcaldas committed Jan 29, 2025
1 parent 645cbdd commit e2b3a20
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 1 addition & 1 deletion tests/test_agents.py
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ async def llm_model_call(*args, **kwargs):
# https://docs.anthropic.com/en/docs/build-with-claude/tool-use#chain-of-thought
# kwargs.pop("tool_choice", LiteLLMModel.TOOL_CHOICE_REQUIRED)
# tool_choice is now a arg, not a kwarg
args.pop() # removing it from args # ASK: I accept ideas on how to handle this better
args = args[:-1] # removing last element from args
return await orig_llm_model_call(*args, tool_choice="auto", **kwargs) # type: ignore[misc]

with patch.object(LiteLLMModel, "call", side_effect=llm_model_call, autospec=True):
Expand Down
4 changes: 1 addition & 3 deletions tests/test_paperqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -427,9 +427,7 @@ def test_llm_parse_json_newlines() -> None:

@pytest.mark.asyncio
async def test_chain_completion() -> None:
s = Settings(
llm="babbage-002", temperature=0.2
)
s = Settings(llm="babbage-002", temperature=0.2)
outputs = []

def accum(x) -> None:
Expand Down

0 comments on commit e2b3a20

Please sign in to comment.