-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy pathdeploy_workflow.py
39 lines (33 loc) · 1.19 KB
/
deploy_workflow.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
from llama_deploy import (
deploy_workflow,
WorkflowServiceConfig,
ControlPlaneConfig
)
from retry_guideline_query_engine_workflow import build_rag_workflow_with_retry_guideline_query_engine
from dotenv import load_dotenv, find_dotenv
_ = load_dotenv(find_dotenv())
async def deploy_rag_workflow_with_retry_guideline_query_engine():
rag_workflow = build_rag_workflow_with_retry_guideline_query_engine()
try:
await deploy_workflow(
workflow=rag_workflow,
workflow_config=WorkflowServiceConfig(
host="127.0.0.1",
port=8004,
# service name matches the name of the workflow used in Agentic Workflow
service_name="rag_workflow_with_retry_guideline_query_engine",
description="RAG workflow",
),
# Config controlled by env vars
control_plane_config=ControlPlaneConfig()
)
except Exception as e:
print(e)
if __name__ == "__main__":
import asyncio
import nest_asyncio
nest_asyncio.apply()
try:
asyncio.run(deploy_rag_workflow_with_retry_guideline_query_engine())
except Exception as e:
print(e)