Skip to content

Conversation

@JubSteven
Copy link
Contributor

Describe this PR

Add support for deepseek V3.1 as llm agent. Since deepseek has a native support for tool calling, we add the corresponding main agent prompt, sub agent prompt and the corresponding llm client.

What changed?

  1. Client-Side Adaptations for Deepseek API
  • Tool List Construction: We now utilize the convert_tool_definition_to_tool_call function to generate the tool_list in the format required by the Deepseek API. This list is passed as a parameter during message creation.
  • Response Handling: The process_llm_response function has been updated to correctly handle responses where finish_reason is tool_call. Specifically, if the LLM returns only tool_calls (llm_response.choices[0].message.tool_calls) without any accompanying text content, we now manually construct the assistant_response (the text portion of the result) to ensure broader compatibility.
  1. Prompt Engineering for Native Tool Calling
    We have introduced new prompts tailored for Deepseek that rely on its native tool-calling capabilities rather than explicit instructions.
  • Main Agent Prompt: A new prompt, MainAgentPromptBoxedDeepseek, has been created based on MainAgentPromptBoxed. The key change is the removal of the system prompt section that dictated the mcp tool-calling format. The underlying assumption is that by providing the tool_list in the API call, the model will correctly format its tool-calling responses without needing explicit syntax guidance.

  • Sub-Agent Prompt: Similarly, SubAgentWorkerPromptDeepSeek has been created by removing the tool-calling syntax description from the original prompt.

Why?

Current prompt assumes the tool calling in a specifc format and uses regular expression for extracting relavent information. But deepseek has a native tool calling format, so the corresponding prompt and response handling needs to be handled differently.

Checklist for PR

  • Write a descriptive PR title following the Angular commit message format: <type>(<scope>): <subject>

    • Examples: feat(agent): add pdf tool via mcp, perf: make llm client async, fix(utils): load custom config via importlib
    • Valid types: feat, fix, docs, style, refactor, perf, test, build, ci, revert
    • The check-pr-title CI job will validate your title format
    • Bad title examples and why they fail:
      • Update README ❌ Missing type and colon
      • feat add new feature ❌ Missing colon after type
      • Feature: add new tool ❌ Invalid type (should be feat)
      • feat(Agent): add tool ❌ Scope should be lowercase
      • feat(): add tool ❌ Empty scope not allowed
      • feat(my_scope): add tool ❌ Underscores not allowed in scope
      • feat(my space): add tool ❌ Space not allowed in scope
      • feat(scope):add tool ❌ Missing space after colon
      • feat(scope): ❌ Empty subject
  • Run lint and format locally:

@BinWang28 BinWang28 merged commit 0d37bec into MiroMindAI:miroflow-v0.3 Oct 16, 2025
1 of 2 checks passed
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 this pull request may close these issues.

2 participants