feat: implement DeepSeek R1 backend with function calling support #94#959
feat: implement DeepSeek R1 backend with function calling support #94#959jhawpetoss6-collab wants to merge 1 commit intocrestalnetwork:mainfrom
Conversation
JiwaniZakir
left a comment
There was a problem hiding this comment.
In r1_backend.py, the call method does no error handling on the HTTP response — response.json() will raise a JSONDecodeError on non-200 responses (e.g., 401 invalid key, 429 rate limit, 500 server error), and even a successful parse will silently return an error payload that the caller has no way to distinguish from a valid completion. At minimum, response.raise_for_status() should be called before .json(), and the constructor should validate that self.api_key is not None rather than letting it surface as a confusing Bearer None auth failure at request time. Additionally, passing "tools": None when no tools are provided will likely cause a validation error from the DeepSeek API — the key should be omitted entirely when tools is None (e.g., conditionally add it to the payload dict). Finally, there's no timeout on the requests.post call, which means a hanging upstream response will block the caller in.
This PR implements the requested DeepSeek R1 support for IntentKit (#94).
Changes:
DeepSeekR1Backendinintentkit/backends/deepseek/./claim #94