发现优质的 AI Agent 技能

聚合 Claude Skills、LangChain、AutoGPT 等优质资源,助力开发者快速构建智能应用

143,627浏览
2下载资源
1用户
广告位 728x90

共 2144 个技能

🔗

Wrong: assuming the workflow stopped immediately

cleanup_resources() # May race with workflow still running its current step ``` **Correct (wait for cancellation to complete):**

aiworkflowsickn33agentic-skills+1
21942
0
🔗

Never start workflows from inside a step!

DBOS.start_workflow(another_workflow) ``` **Incorrect (modifying global state):**

workflowsickn33agentic-skillsai-agents+1
21942
0
🔗

Long running work

pass thread = threading.Thread(target=long_task, args=(data,)) thread.start() ```

sickn33agentic-skillsai-agentsantigravity+1
21942
0
🔗

DBOS state from previous test!

result = another_workflow() ``` **Correct (reset fixture):**

workflowsickn33agentic-skillsai-agents+1
21942
0
🔗

For Postgres, use transactions instead of steps

engine.execute("INSERT INTO table VALUES (?)", data) ``` **Correct (using transaction):**

postgressickn33agentic-skillsai-agents+1
21942
0
🔗

Manual retry logic is error-prone

for attempt in range(3): try: return requests.get("https://api.example.com").json() except Exception: if attempt == 2:

apisickn33agentic-skillsai-agents+1
21942
0
🔗

External API call directly in workflow - not checkpointed!

response = requests.get("https://api.example.com/data") return response.json() ``` **Correct (external call in step):**

apiworkflowsickn33agentic-skills+1
21942
0
🔗

May hit rate limits if too many calls

return openai.chat.completions.create(...) ``` **Correct (with rate limit):**

openaiaichatsickn33+1
21942
0
🔗

All tasks treated equally - urgent tasks may wait

for task in tasks: queue.enqueue(process_task, task) ``` **Correct (with priority):**

aisickn33agentic-skillsai-agents+1
21942
0
🔗

One user blocks all other users!

queue.enqueue(process_task, task) ``` **Correct (per-user limits with partitioning):**

sickn33agentic-skillsai-agentsantigravity+1
21942
0
🔗

Every worker processes both queues

if __name__ == "__main__": DBOS(config=config) DBOS.launch() ``` **Correct (workers listen to specific queues):**

aisickn33agentic-skillsai-agents+1
21942
0
🔗

Multiple requests = multiple workflows for same user!

queue.enqueue(process_workflow, user_id) ``` **Correct (deduplicated by user):**

workflowsickn33agentic-skillsai-agents+1
21942
0
广告位 728x90