Skip to content

Comments

First slack tool pydantic ai#10

Merged
fbraza merged 4 commits intomainfrom
first-slack-tool-pydantic-ai
Sep 29, 2025
Merged

First slack tool pydantic ai#10
fbraza merged 4 commits intomainfrom
first-slack-tool-pydantic-ai

Conversation

@fbraza
Copy link
Collaborator

@fbraza fbraza commented Sep 29, 2025

No description provided.

@fbraza fbraza merged commit 4fb432f into main Sep 29, 2025
2 checks passed
Copy link

@chatgpt-codex-connector chatgpt-codex-connector bot left a comment

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Comment on lines +19 to +26
@slack_toolset.tool(name="slack.chat.postMessage")
def post_message(
ctx: RunContext[Deps], params: SlackChatPostMessageParams
) -> SlackResponse:
"""
Use this function to post a message in the specified channel
"""
return ctx.deps.client.chat_postMessage(channel=params.channel, text=params.text)

Choose a reason for hiding this comment

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

[P1] Return SlackResponse from tool prevents serialization

The new post_message tool returns the SlackResponse object directly. When this function is executed via FunctionToolset, the agent has to JSON‑serialize the tool’s output to send it back to the model. SlackResponse carries non‑serializable attributes (e.g., the underlying WebClient and requests.Response), so the agent will raise a TypeError instead of reporting the Slack call result. Consider returning a plain dict/BaseModel such as response.data so the tool output can be encoded.

Useful? React with 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant