Created
January 8, 2026 13:36
-
-
Save larkintuckerllc/1fd2fdb806c3dbfc6ac360e8cae23f63 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| diff --git a/app.py b/app.py | |
| index 35b1f94..09860d5 100644 | |
| --- a/app.py | |
| +++ b/app.py | |
| @@ -3,12 +3,21 @@ import threading | |
| from langchain.agents import create_agent | |
| from langchain.messages import HumanMessage | |
| +from langchain.tools import tool | |
| from slack_bolt import App | |
| from slack_bolt.adapter.socket_mode import SocketModeHandler | |
| from slack_sdk.errors import SlackApiError | |
| app = App(token=os.environ.get("SLACK_BOT_TOKEN")) | |
| -agent = create_agent(model="gpt-5-nano") | |
| + | |
| +@tool | |
| +def square_root(x: float) -> float: | |
| + """ | |
| + Calculate the square root of a number. | |
| + """ | |
| + return x ** 0.5 | |
| + | |
| +agent = create_agent(model="gpt-5-nano", tools=[square_root]) | |
| def thinking(prompt, client, channel_id, thread_ts): | |
| response = agent.invoke({ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment