Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 0 additions & 23 deletions agent_tool/src/agents/chat_tool_functions.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# ruff: noqa: ERA001
from datetime import timedelta

from pydantic import BaseModel
Expand All @@ -9,8 +8,6 @@

from src.functions.llm_chat import LlmChatInput, Message, llm_chat
from src.functions.lookup_sales import LookupSalesInput, lookup_sales
# Step 2: Import your new function to the agent
# from src.functions.new_function import new_function, FunctionInput, FunctionOutput


class MessageEvent(BaseModel):
Expand All @@ -37,15 +34,8 @@ async def message(self, message: MessageEvent) -> list[Message]:
name=lookup_sales.__name__,
description="Lookup sales for a given category",
),
# Step 3 Add your new function to the tools list and adjust the system prompt
# pydantic_function_tool(
# model=FunctionInput,
# name=new_function.__name__,
# description="A function to talk to an ERP to get the latest sales data"
# )
]

# Change the system prompt to the agent
system_content = "You are a helpful assistant that can help with sales data."

self.messages.append(Message(role="user", content=message.content or ""))
Expand Down Expand Up @@ -113,19 +103,6 @@ async def message(self, message: MessageEvent) -> list[Message]:
or "",
)
)

## Step 4: Add your new function to the match case and append the result to the messages
# case new_function.__name__:
# args = FunctionInput.model_validate_json(tool_call.function.arguments)

# log.info(f"calling {name} with args: {args}")

# result = await workflow.step(new_function, input=FunctionInput(message=args.message), start_to_close_timeout=timedelta(seconds=120))
# self.messages.append(Message(role="tool", tool_call_id=tool_call.id, content=str(result)))

# completion_with_tool_call = await workflow.step(llm_chat, LlmChatInput(messages=self.messages), start_to_close_timeout=timedelta(seconds=120))
# self.messages.append(Message(role="assistant", content=completion_with_tool_call.choices[0].message.content or ""))

else:
pass

Expand Down
27 changes: 0 additions & 27 deletions agent_tool/src/functions/new_function.py

This file was deleted.

5 changes: 0 additions & 5 deletions agent_tool/src/services.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# ruff: noqa: ERA001
import asyncio
import logging
import webbrowser
Expand All @@ -11,14 +10,10 @@
from src.functions.llm_chat import llm_chat
from src.functions.lookup_sales import lookup_sales

# Step 5: Import a new function to tool calling here
# from src.functions.new_function import new_function, FunctionInput, FunctionOutput


async def main() -> None:
await client.start_service(
agents=[AgentChatToolFunctions],
## Step 6: Add your new function to the functions list -> functions=[lookupSales, llm_chat, new_function]
functions=[lookup_sales, llm_chat],
)

Expand Down