feat: solution for 'Агент с RAG-памятью'
CI / build (push) Has been cancelled

This commit is contained in:
2026-06-29 17:42:08 +03:00
parent f3a37e6521
commit e47bfa261d
6 changed files with 222 additions and 80 deletions
+41
View File
@@ -0,0 +1,41 @@
from langchain.tools import tool
from typing import List
@tool
def add_numbers(a: int, b: int) -> int:
"""
Add two numbers and return the sum.
Parameters
----------
a : int
The first number.
b : int
The second number.
Returns
-------
int
The sum of a and b.
"""
return a + b
@tool
def search_item(items: List[str], query: str) -> List[str]:
"""
Search for items containing the query string (case-insensitive).
Parameters
----------
items : List[str]
The list of items to search.
query : str
The search query.
Returns
-------
List[str]
A list of items that contain the query string.
"""
query_lower = query.lower()
return [item for item in items if query_lower in item.lower()]