Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add slackbot example and update typing + debug logs #363

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

zzstoatzz
Copy link
Collaborator

@zzstoatzz zzstoatzz commented Oct 24, 2024

adds an initial FastAPI slackbot example and updates some typing on the Flow class so that its clear to users in their IDE what things Flow accepts

also fixes the async case with as_task (test_task_decorator_async_as_task was throwing an "unawaited cororoutine" error)


relatedly in PrefectHQ/prefect#15792, we noticed that default= is required in Field definitions for the type checker to recognize defaults as "not required" by the constructor of a model like Flow


i plan to add to this slackbot over time

@github-actions github-actions bot added the example Includes an example label Oct 24, 2024
@zzstoatzz zzstoatzz requested a review from jlowin October 24, 2024 17:06
@@ -289,7 +289,9 @@ def _run_model(
tools = as_tools(self.get_tools() + tools)
model = self.get_model(tools=tools)

logger.debug(f"Running model {model} for agent {self.name} with tools {tools}")
logger.debug(
f"Running model {controlflow.settings.llm_model} for agent {self.name} with tools {[t.name for t in tools]!r}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is actually not correct for the model -- this will log the global setting, not the agent's own setting (if it was overridden)

src/controlflow/agents/agent.py Outdated Show resolved Hide resolved
src/controlflow/agents/agent.py Outdated Show resolved Hide resolved
Copy link
Member

@jlowin jlowin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @zzstoatzz!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Includes an example
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants