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

Merged
merged 9 commits into from
Oct 26, 2024
Merged

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!

@github-actions github-actions bot added the tests Adds or improves unit tests label Oct 26, 2024
@zzstoatzz zzstoatzz force-pushed the slackbot branch 2 times, most recently from 1763e98 to 41954d2 Compare October 26, 2024 21:22
@zzstoatzz zzstoatzz merged commit aa4fae4 into main Oct 26, 2024
4 checks passed
@zzstoatzz zzstoatzz deleted the slackbot branch October 26, 2024 21:51
@zzstoatzz zzstoatzz mentioned this pull request Oct 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
example Includes an example tests Adds or improves unit tests
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants