PrefectHQ / ControlFlow

🦾 Take control of your AI agents
https://controlflow.ai
Apache License 2.0
590 stars 39 forks source link

Prefect's latest release seems to have broken controlflow #288

Closed AliButtar closed 2 weeks ago

AliButtar commented 3 weeks ago

Description

Controlflow is giving an error with prefect==3.0.0. If I downgrade to the pre-release version that is prefect==3.0.0rc20, then it works completely fine as expected.

Example Code

No response

Version Information

This command doesn't work but my Controlflow version is 0.8.2

Here is a prefect version though:
Version:             3.0.0rc20
API version:         0.8.4
Python version:      3.12.5
Git commit:          6dd34dc6
Built:               Thu, Aug 29, 2024 12:06 PM
OS/Arch:             darwin/arm64
Profile:             default
Server type:         server
Pydantic version:    2.8.2

Additional Context

Traceback (most recent call last):
  File "/Users/ali/Documents/projects/market-researcher/test.py", line 49, in <module>
    from market_researcher import MarketResearcher
  File "/Users/ali/Documents/projects/market-researcher/src/market_researcher/market_researcher.py", line 4, in <module>
    from main import research_topic
  File "/Users/ali/Documents/projects/market-researcher/src/market_researcher/main.py", line 1, in <module>
    import controlflow as cf
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/__init__.py", line 5, in <module>
    from .agents import Agent
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/agents/__init__.py", line 1, in <module>
    from . import memory
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/agents/memory.py", line 7, in <module>
    from controlflow.tools import Tool
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/tools/__init__.py", line 1, in <module>
    from controlflow.llm.tools import tool, Tool, as_tools
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/llm/__init__.py", line 1, in <module>
    from controlflow.llm import models, messages, tools, handlers, completions, rules
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/llm/tools.py", line 16, in <module>
    from controlflow.utilities.prefect import create_markdown_artifact, prefect_task
  File "/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/controlflow/utilities/prefect.py", line 22, in <module>
    from prefect.results import ResultFactory
ImportError: cannot import name 'ResultFactory' from 'prefect.results' (/Users/ali/Library/Caches/pypoetry/virtualenvs/market-researcher-LxA9ZOSo-py3.12/lib/python3.12/site-packages/prefect/results.py). Did you mean: 'ResultRecord'?
jlowin commented 2 weeks ago

Thank you! 0.8.3 is out with a hotfix for this, and the (proper) Prefect-3 compatible CF 0.9 will be out soon! #296