-
Notifications
You must be signed in to change notification settings - Fork 9k
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
Function calling #9
Comments
x2 |
x2 + 1 |
x2 + 2 |
x2 + 3 |
x2 + 4 |
x2 + 5 |
Response to Issue #9: Function Calling and Structured OutputsThank you for your question and for the community’s interest in this feature! Below, I’ve addressed the current status and future plans for function calling and structured outputs in DeepSeek R1. Current Status
Future Plans
Timeline
Workarounds for NowIf you need structured outputs or function-like behavior in the meantime, here are some workarounds:
Community FeedbackWe appreciate the enthusiasm from the community (x2 + 5 and counting!). Your feedback is invaluable in shaping the future of DeepSeek R1. If you have specific use cases or feature requests related to function calling and structured outputs, please share them in this thread. Next Steps
Thank you for your patience and support as we work to make DeepSeek R1 even better! Let us know if you have further questions or need additional assistance. |
Thank you developers for explaining your plans to us. Don’t worry, if the application direction of R1 is not in the Agent field, developers can go in their own direction. |
Use R1 as the master brain for tool decision / plan, and rewrite the output in structure with another model. |
I would really like the model to support structured output, such as JSON. For now, no matter how much I tell it to only output JSON it is not consistent. I don't mind the section I think that is useful and very easy to remove with some string handling, but it needs to adhere to JSON output if asked in its final response. |
Fixes deepseek-ai#9 Add support for function calling and structured outputs. * **README.md** - Add a section about function calling and structured outputs. - Include examples of using function calling and structured outputs. - Mention the future plans for these features. * **src/model.py** - Add support for structured data formats like JSON and XML. - Implement function calling capabilities. - Include integration with external tools and APIs. * **src/utils.py** - Add utility functions for parsing and generating structured data formats. - Include helper functions for function calling. * **tests/test_model.py** - Add unit tests for structured data format support. - Include tests for function calling capabilities. - Add tests for API integration. * **tests/test_utils.py** - Add unit tests for utility functions related to structured data formats. - Include tests for helper functions for function calling. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/deepseek-ai/DeepSeek-R1/issues/9?shareId=XXXX-XXXX-XXXX-XXXX).
Also looking for this |
Bump, definitely bump |
When will R1 support agent? |
response_format: { type: 'json_object' } |
Thank you. I look forward to having a provider that allows my Microsoft Semantic Kernel powered application to use Deepseek as an alternative for auto function calling. |
x2 |
https://github.com/justinlietz93/agent_tools I built a suite of tools and a wrapper for deepseek reasoner to use, check it out |
My application automates code generation using file operations via functional calls. Currently, integrating R1 requires significant refactoring due to the lack of function calling support, even though this feature is already standardized in most models (OpenAI, Anthropic, Mistral, etc.). To migrate from other models to R1, I must rewrite critical components of the application, which increases transition costs and error risks. Without function calling support, developers are forced to adopt less efficient workarounds or delay adopting R1, despite its exceptional code generation capabilities. Accelerating the development of function calling for R1 will lower the entry barrier for communities relying on industry-standard approaches. |
Can you please email me, feel free to look at my agent_tools repo, I have powerful tools for Deepseek R1 and I’m improving them daily. [email protected], I have more contact links on my github |
go |
Agree with the original feature request ( function calling and structured outputs standard features on a API now), without structured outputs, it's nearly impossible to achieve targeted data accuracy levels for many applications. When needing data accuracy of 99.999% on large volumes ( hundreds of thousands of records), structured outputs made a huge difference in the accuracy of my responses for unstructured ( document store) database queries using o1-mini. Function calling, yes, I could do the workaround as suggested), but given the time and effort I already put into the development of the autonomous agent back end programming, I'd prefer not to go backwards and put in workarounds to use R1 when hopefully my existing code using function calling will be adequate when the R series of models and the DeepSeek API can in fact support function calling - hopefully the DeepSeek function calling and structured outputs performance will be just as good as on the OpenAI API using o1 and gpt-4o. |
x2 |
We got function-calling to work with R1 using our framework BAML: https://www.boundaryml.com/blog/deepseek-r1-function-calling . We haven't had any issues making it spit out structured data. It doesn't need tool-apis or whatnot, we just serialize types into the prompt in an efficient way, and parse the output using a custom JSON parser to handle missing quotes etc. Let us know if you do. Here is our open-source repo: https://github.com/BoundaryML/baml |
I'm also looking forward |
Awesome I’m going to take a look, because I’ve been building something for the same idea, to allow any LLM to use any tool |
Looking forward deep seek with function calling |
+1 |
In case this is helpful for others, looks like the Qwen-32B distillation https://huggingface.co/deepseek-ai/DeepSeek-R1-Distill-Qwen-32B/discussions/7 has support for function calling. |
Asking for Thanks for the effort |
One possible alternative to builtin function calling via JSON is to leverage DeepSeek-R1's strong coding capabilities and let the model generate code actions in Python. I experimented with this approach and found that it outperforms Claude 3.5 Sonnet on agentic tasks by a large margin (65.5% vs 53.1% on a GAIA validation subset). I used freeact as agent scaffold. |
I've spent the past week testing DeepSeek R1 with Cline, Roo Coder and a number of other agentic coding tools using a combination of templates and prompting methods. While R1 is clearly a very capable model in general - in reality it's not practical to use (especially in production) due to it's lack of tool/function calling. I believe what we need is a battle-tested template or fine tune from DeepSeek to enable reliable tool/function calling. |
When will R1 support function calling and structured outputs? Thanks
The text was updated successfully, but these errors were encountered: