How to integrate my algorithm API into Dify? #31319
Replies: 1 comment
-
|
You can integrate your algorithm API into a Dify workflow using either an HTTP Request Node or a Code Node: 1. HTTP Request Node: 2. Code Node: import httpx
def main(input_value: str) -> dict:
response = httpx.post("http://your-api-url/endpoint", json={"input": input_value})
response.raise_for_status()
return {"result": response.json()}Important tips:
Workflow example diagram: graph LR
A["Start Node (inputs)"] --> B["HTTP Request Node or Code Node"]
B --> C["Next Workflow Step"]
If you have advanced needs (like plugin development, file handling, or agent integration), let me know your scenario! To reply, just mention @dosu. How did I do? Good | Irrelevant | Incorrect | Verbose | Hallucination | Report 🐛 | Other |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Self Checks
Content
I have already developed my own algorithm and packaged it as an API that can be requested via a URL. How can I integrate it into a Dify workflow? Is it possible to set up a node to request this API?
Beta Was this translation helpful? Give feedback.
All reactions