You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Response to Issue #9: Function Calling and Structured Outputs
Thank 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
As of now, DeepSeek R1 does not natively support function calling or structured outputs.
The model is primarily optimized for reasoning-heavy tasks (e.g., math, code, and STEM) and follows a conversational format.
Future Plans
We recognize the importance of function calling and structured outputs for many use cases, such as API integrations, automation, and data extraction.
We are actively exploring ways to add support for these features in future updates. This includes:
Extending the model’s capabilities to handle structured data formats (e.g., JSON, XML).
Adding support for function calling to enable seamless integration with external tools and APIs.
Timeline
While we don’t have a specific release date yet, we aim to roll out these features in the next major update.
We will keep the community updated on our progress through GitHub announcements and release notes.
Workarounds for Now
If you need structured outputs or function-like behavior in the meantime, here are some workarounds:
Post-Processing Outputs:
Use a script to parse the model’s responses into structured formats (e.g., JSON).
Example:
importjsonresponse=model.generate("Extract the following data as JSON: ...")
structured_data=json.loads(response)
Prompt Engineering:
Design prompts to guide the model to produce outputs in a specific format.
Example:
Extract the following information and format it as JSON:
- Name: ...
- Age: ...
- Location: ...
Custom Wrapper:
Build a custom wrapper around the model to simulate function calling behavior.
Example:
defcall_function(model, function_name, args):
prompt=f"Call function {function_name} with args {args} and return the result."returnmodel.generate(prompt)
Community Feedback
We 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
We will prioritize this feature based on community demand and provide updates as development progresses.
Stay tuned for announcements and feel free to contribute ideas or suggestions!
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.
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.
Activity
FORNDODAper commentedon Jan 21, 2025
x2
('x2' stands for 'yeah, i would like to know that too')
reatang commentedon Jan 21, 2025
x2 + 1
flyfish101 commentedon Jan 21, 2025
x2 + 2
liberty-rapid commentedon Jan 21, 2025
x2 + 3
lzl-mt commentedon Jan 21, 2025
x2 + 4
juanjopc commentedon Jan 21, 2025
x2 + 5
engalisabry commentedon Jan 21, 2025
Response to Issue #9: Function Calling and Structured Outputs
Thank 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 Now
If you need structured outputs or function-like behavior in the meantime, here are some workarounds:
Post-Processing Outputs:
Prompt Engineering:
Custom Wrapper:
Community Feedback
We 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.
ibndias commentedon Jan 22, 2025
Use R1 as the master brain for tool decision / plan, and rewrite the output in structure with another model.
jacobpretorius commentedon Jan 22, 2025
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.
Add function calling and structured outputs support
Chrisbattarbee commentedon Jan 22, 2025
Also looking for this
feliks912 commentedon Jan 23, 2025
Bump, definitely bump
jayeew commentedon Jan 23, 2025
When will R1 support agent?
letscagefdn commentedon Jan 23, 2025
response_format: { type: 'json_object' }
69 remaining items