Skip to content

Commit

Permalink
Merge pull request #255 from PrefectHQ/ten
Browse files Browse the repository at this point in the history
v0.9 foundation
  • Loading branch information
jlowin authored Sep 2, 2024
2 parents 4625028 + ab2c29d commit 6a1b384
Show file tree
Hide file tree
Showing 53 changed files with 1,074 additions and 1,371 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,9 @@ jobs:
- name: Install ControlFlow
run: uv pip install --system ".[tests]"

- name: Install Prefect @ b6d19c1 (remove after release)
run: uv pip install --system prefect@git+https://github.com/prefecthq/prefect@b6d19c1

- name: Run tests
run: pytest -vv
if: ${{ !(github.event.pull_request.head.repo.fork) }}
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
repos:
- repo: https://github.com/astral-sh/ruff-pre-commit
# Ruff version.
rev: v0.4.9
rev: v0.6.2
hooks:
# Run the linter.
- id: ruff
Expand All @@ -10,7 +10,7 @@ repos:
- id: ruff-format

- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.10.0
rev: v1.11.2
hooks:
- id: mypy
additional_dependencies:
Expand Down
3 changes: 2 additions & 1 deletion examples/business_headline_sentiment.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
# uv pip install langchain-community, duckduckgo-search

import controlflow as cf
from langchain_community.tools import DuckDuckGoSearchRun

import controlflow as cf

summarizer = cf.Agent(
name="Headline Summarizer",
description="An AI agent that fetches and summarizes current events",
Expand Down
3 changes: 2 additions & 1 deletion examples/controlflow_docs.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
from pathlib import Path

from langchain_openai import OpenAIEmbeddings

import controlflow as cf
from controlflow.tools import tool
from langchain_openai import OpenAIEmbeddings

try:
from langchain_community.document_loaders import DirectoryLoader
Expand Down
3 changes: 2 additions & 1 deletion examples/engineer/engineer.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from pathlib import Path

from pydantic import BaseModel

import controlflow as cf
import controlflow.tools.code
import controlflow.tools.filesystem
from pydantic import BaseModel

# load the instructions
instructions = open(Path(__file__).parent / "instructions.md").read()
Expand Down
2 changes: 1 addition & 1 deletion examples/multi_agent_conversation.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def demo(topic: str):
context=dict(topic=topic),
instructions="every agent should speak at least once. only one agent per turn. Keep responses 1-2 paragraphs max.",
)
return task
task.run()


if __name__ == "__main__":
Expand Down
3 changes: 2 additions & 1 deletion examples/poem.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from controlflow import Agent, Task, flow, instructions, task
from pydantic import BaseModel

from controlflow import Agent, Task, flow, instructions, task


class Name(BaseModel):
first_name: str
Expand Down
3 changes: 2 additions & 1 deletion examples/restaurant_recs.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from controlflow import Task, flow
from pydantic import BaseModel

from controlflow import Task, flow


class Restaurant(BaseModel):
name: str
Expand Down
3 changes: 2 additions & 1 deletion src/controlflow/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@
from controlflow.defaults import defaults

from .agents import Agent
from .tasks import Task
from .tasks import Task, run, run_async
from .flows import Flow
from .orchestration import turn_strategies


from .instructions import instructions
Expand Down
3 changes: 1 addition & 2 deletions src/controlflow/agents/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
from . import memory
from .agent import Agent, BaseAgent
from .teams import RoundRobinTeam, Team
from .agent import Agent
Loading

0 comments on commit 6a1b384

Please sign in to comment.