From b3af3b1f9709860054a7c572a95c16b71fcad000 Mon Sep 17 00:00:00 2001 From: root Date: Thu, 20 Nov 2025 11:43:55 +0800 Subject: [PATCH] =?UTF-8?q?add=20workflow=20=E5=B8=82=E5=9C=BA-Agents?= =?UTF-8?q?=E8=B0=83=E5=BA=A6,dev?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../泰克产品相关性分析/tk_product_prefer.py | 20 ++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/dev/workflow/TK_Cust/agents_market_newsletter/泰克产品相关性分析/tk_product_prefer.py b/dev/workflow/TK_Cust/agents_market_newsletter/泰克产品相关性分析/tk_product_prefer.py index 53a48f4..8cf971e 100644 --- a/dev/workflow/TK_Cust/agents_market_newsletter/泰克产品相关性分析/tk_product_prefer.py +++ b/dev/workflow/TK_Cust/agents_market_newsletter/泰克产品相关性分析/tk_product_prefer.py @@ -72,8 +72,9 @@ class APIClient: Returns: API响应数据 """ + inputs_data = {} payload = { - "inputs": {}, + "inputs": inputs_data, "response_mode": "blocking", "user": "admin" } @@ -108,7 +109,7 @@ class APIClient: } - def call_api_with_query(self, query: str = None) -> Dict[str, Any]: + def call_api_with_query(self, inputs: Dict[str, Any] = None, query: str = None) -> Dict[str, Any]: """直接调用带inputs参数的API Args: @@ -118,11 +119,10 @@ class APIClient: API响应数据 """ payload = json.dumps({ - "inputs": None, - "query" : query, + "inputs": inputs, + "query": query, "response_mode": "streaming", - "user": "admin", - "conversation_id":"" + "user": "admin" }) try: @@ -307,9 +307,10 @@ def main(): else: #agent + inputs_data = {} query = text logger.info(f"call_api_with_query") - result = api_client.call_api_with_query(query) + result = api_client.call_api_with_query(inputs_data, query) if result['success']: logger.info(f"URL {text} 处理成功") @@ -329,6 +330,9 @@ def main(): else: logger.info("调用不带inputs参数的API示例") if type == 'workflow': + + inputs_data = {} + result2 = api_client.call_api_without_inputs() if result2['success']: @@ -338,6 +342,8 @@ def main(): else: #agent + inputs_data = {} + result2 = api_client.call_api_without_query() if result2['success']: