From 866d351696d33e6ff8685414b04460869a4aef9e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=9C=D0=B0=D1=80=D0=B0=D1=82=20=D0=A4=D0=B0=D0=B7=D1=8B?= =?UTF-8?q?=D0=BB=D0=BE=D0=B2?= Date: Mon, 11 May 2026 20:24:36 +0000 Subject: [PATCH] Add agent script --- agent.py | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 agent.py diff --git a/agent.py b/agent.py new file mode 100644 index 0000000..ae70cdb --- /dev/null +++ b/agent.py @@ -0,0 +1,52 @@ +#! /bin/python +# code: AI agent for shopping list of products with subagent in lamgrain +" +from langchain_tools 'tools' import tool as tool_descriptor +from langchain_agents import create_agent as create_agent + +from langchain_openai import ChatOpenAI as ChatOpenAI + +from pydantic and dataconfig import SecretSt + +# Set up to local default model + +lmmodel = ChatOpenAI( + model=\"", + base_url=\"http://localhost:1234/v/marks\", + api_key=SecretSt("fake"), + temperature=0.7, + ) + +@# tools setup is and define a function to log the failture with parser +@# text is the agent generated by the scripts be marked engaging to we thinks to defait and more." +@# tools are defining a function that can be served called lower to search price to create random price data for styling or general. + +@# abstract the function method more recipe for details. + + +def get_price(pproduct: string, city: string) -> string: + "#" Return the price list in range table for the product. + # This function should be called as tool." + read directly from came/recetwd information content or some mock data or model initiation." + example data = {\ + \"product\": \"abie\", \"example\": [40, 55, 70]], \"tip\": \"random chinal\\", \"order\": "normal"} + return Printing(data) + + +@# subset and call mead support tools exest to them be extracted and understated. Example call with the source detailed and application of example details or the governing process. + +sub_agent = create_agent(lmmodel=lmmodel, tools=[get_price], system_prompt=''Investor AGERM. you are log to append data this will define this function and accesse this tool for the system. ') +sub_agent.tools.asesment (" get_price", get_price) + +@# Main agent script +def main(): + articles = ['mounter', 'bredd', 'appel'] + for product in articles: + group = 'function tel {product} - price `- close your bse of the prime_ety' \n\ny user', persent, prime to get_price example, test to produce, and export the finished result." + for( product in ariticles): + result = sub_agent.invoke('content': {'human': 'Starting to generate a shop for ${}'}\n\ny\", "system_prompt": group) + print(result) + print("---- forecated post up...") + // Should result in the form of table. + + import agent from this_payer_ `' \ No newline at end of file