Ahronn
08/27/2024, 10:43 PMservices:
cf:
build: .
environment:
- ANTHROPIC_API_KEY=${ANTHROPIC_API_KEY}
- CONTROLFLOW_DEFAULT_LLM=${CONTROLFLOW_DEFAULT_LLM}
develop:
watch:
- action: sync
path: ./test.py
target: /app/test.py
- action: rebuild
path: ./test.py
stdin_open: true
tty: true
My requirements.txt only includes controlflow and langchain_anthropic.
The Python code I'm trying to run:
import controlflow as cf
task = cf.Task(
"Write a short poem about nature",
result_type=str,
instructions="Feel free to choose any poetic form that fits the theme."
)
task.run()
Could you please advise on what might be causing this timeout and how to resolve it? I think I'm totally missing some points... (I'm not familiar at all with Prefect and wanted to test out Controlflow, it seems really incredible !)
Thank you for your help!Nate
08/27/2024, 11:35 PMservices:
postgres:
image: postgres:16
ports:
- 5432:5432
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
prefect-server:
image: prefecthq/prefect:3.0.0rc19-python3.12
command: prefect --no-prompt server start --host 0.0.0.0
ports:
- 4200:4200
environment:
PREFECT_API_DATABASE_CONNECTION_URL: <postgresql+asyncpg://postgres:postgres@postgres:5432/postgres>
depends_on:
- postgres
and then your existing service below that would depend on theseNate
08/27/2024, 11:38 PMDave Aitel
08/28/2024, 5:38 PMDave Aitel
08/28/2024, 5:50 PMAhronn
08/29/2024, 1:50 PMCONTROLFLOW_DEFAULT_LLM="anthropic/claude-3-haiku-20240307"
am I missing something ?)
Anyway it works well with :
import controlflow as cf
from langchain_anthropic import ChatAnthropic
model = ChatAnthropic(model="claude-3-haiku-20240307")
agent = cf.Agent(model=model)
task = cf.Task(
"Write a short poem about nature",
result_type=str,
instructions="Feel free to choose any poetic form that fits the theme.",
agents=[agent]
)
task.run()
Dave Aitel
08/29/2024, 1:54 PMDave Aitel
08/29/2024, 1:56 PMDave Aitel
08/29/2024, 1:58 PMDave Aitel
08/29/2024, 1:59 PMAhronn
08/29/2024, 3:11 PMDave Aitel
08/29/2024, 3:27 PMAhronn
08/29/2024, 3:30 PMDave Aitel
08/29/2024, 3:37 PMAhronn
08/29/2024, 7:02 PMDave Aitel
08/29/2024, 7:08 PMDave Aitel
08/29/2024, 7:08 PM