mirror of
https://github.com/dograh-hq/dograh.git
synced 2026-06-13 08:15:21 +02:00
feat: refactor node spec and add mcp tools (#244)
* refactor: carve out extraction panel * refactor: create spec versions for node types * refactor: create a GenericNode and remove custom nodes * feat: add python and typescript sdk * add dograh sdk * fix: fetch draft workflow definition over published one * fix: fix routes of SDKs to use code gen * chore: remove doclink dependency to reduce image size * chore: format files * chore: bump pipecat * feat: let mcp fetch archived workflows on demand * chore: fix tests * feat: add sdk documentation * chore: change banner and add badge
This commit is contained in:
parent
0a61ef295f
commit
00a1a22b74
162 changed files with 14355 additions and 3554 deletions
32
sdk/python/src/dograh_sdk/errors.py
Normal file
32
sdk/python/src/dograh_sdk/errors.py
Normal file
|
|
@ -0,0 +1,32 @@
|
|||
"""SDK-level exceptions.
|
||||
|
||||
All errors raised from `dograh_sdk` are subclasses of `DograhSdkError` so
|
||||
calling code can catch them as one category.
|
||||
"""
|
||||
|
||||
|
||||
class DograhSdkError(Exception):
|
||||
"""Base class for all SDK errors."""
|
||||
|
||||
|
||||
class ValidationError(DograhSdkError):
|
||||
"""Raised when node data fails client-side validation (unknown field,
|
||||
missing required field, obvious type mismatch).
|
||||
|
||||
Server-side Pydantic validation runs on save and may raise further
|
||||
errors via `ApiError` — this class covers the fast-fail cases caught
|
||||
at the `Workflow.add()` call site.
|
||||
"""
|
||||
|
||||
|
||||
class ApiError(DograhSdkError):
|
||||
"""Raised when the Dograh backend returns a non-2xx response."""
|
||||
|
||||
def __init__(self, status_code: int, message: str, body: object = None):
|
||||
super().__init__(f"[{status_code}] {message}")
|
||||
self.status_code = status_code
|
||||
self.body = body
|
||||
|
||||
|
||||
class SpecMismatchError(DograhSdkError):
|
||||
"""Raised when a referenced node type isn't registered on the server."""
|
||||
Loading…
Add table
Add a link
Reference in a new issue