Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

bug: DeepSeek agent fails to execute tools properly #299

Closed
1 task done
nanlong opened this issue Feb 12, 2025 · 2 comments
Closed
1 task done

bug: DeepSeek agent fails to execute tools properly #299

nanlong opened this issue Feb 12, 2025 · 2 comments

Comments

@nanlong
Copy link

nanlong commented Feb 12, 2025

  • I have looked for existing issues (including closed) about this

Bug Report

The DeepSeek agent fails to properly execute tools when running the calculator example. While the basic text generation works, the agent does not correctly handle tool calls for arithmetic operations.

Reproduction

  1. Run the calculator example:
cargo run --example agent_with_deepseek
  1. The example code:
let calculator_agent = client
    .agent(providers::deepseek::DEEPSEEK_CHAT)
    .preamble("You are a calculator here to help the user perform arithmetic operations. Use the tools provided to answer the user's question.")
    .max_tokens(1024)
    .tool(Adder)
    .tool(Subtract)
    .build();

println!("Calculate 2 - 5");
println!(
    "DeepSeek Calculator Agent: {}",
    calculator_agent.prompt("Calculate 2 - 5").await?
);

Expected behavior

  • The agent should recognize the arithmetic operation #request
  • Use the appropriate tool (Subtract in this case)
  • Return the calculated result (-3)

Actual behavior

The agent fails to properly execute the tool calls, either:

  • Not recognizing the need to use tools
  • Or failing to properly format tool calls
  • Or not handling tool responses correctly

Environment

  • Rust version: (1.84.1)
  • OS: (macOs Sonoma 14.5)
  • Rig version: (0.8.0)

Additional context

This appears to be specific to the DeepSeek provider implementation, as similar tool usage works with other providers. The issue impacts the core functionality of using tools with DeepSeek agents.

@0xMochan
Copy link
Contributor

Hey, thanks for this issue! PR #283 just got merged, does this solve this issue?

@nanlong nanlong closed this as completed Feb 12, 2025
@nanlong
Copy link
Author

nanlong commented Feb 12, 2025

Yes, there are no more questions. Thank you for your work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants