Skip to content

Commit 2ada4db

Browse files
committed
try to use dbos locally
1 parent 442133e commit 2ada4db

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

durable-exec/twenty_questions_dbos.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import asyncio
2-
import os
32
import sys
43
import uuid
54
from dataclasses import dataclass
@@ -78,15 +77,17 @@ async def play(resume_id: str | None, answer: str) -> AgentRunResult[str]:
7877
config: DBOSConfig = {
7978
'name': 'twenty_questions_durable',
8079
'enable_otlp': True,
81-
'conductor_key': os.environ.get('DBOS_CONDUCTOR_KEY', None),
80+
# run the server with
81+
# docker run -e POSTGRES_HOST_AUTH_METHOD=trust --rm -it --name pg -p 5432:5432 -d postgres
82+
'system_database_url': 'postgresql://postgres@localhost:5432/dbos',
8283
}
8384
DBOS(config=config)
8485
DBOS.launch()
85-
wf_id = f'twenty-questions-{uuid.uuid4()}'
8686
if resume_id is not None:
8787
print('resuming existing workflow', resume_id)
8888
wf_id = resume_id
8989
else:
90+
wf_id = f'twenty-questions-{uuid.uuid4()}'
9091
print('starting new workflow', wf_id)
9192

9293
state = GameState(answer=answer)

0 commit comments

Comments
 (0)