From 5e7ef8771236afbf6c6a0841aeaa0be8f1d9f099 Mon Sep 17 00:00:00 2001 From: redbotu Date: Mon, 25 May 2026 22:06:41 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E6=B8=85=E7=90=86=E6=B5=8B=E8=AF=95?= =?UTF-8?q?=E6=96=87=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../__pycache__/config.cpython-313.pyc | Bin 453 -> 0 bytes langgraph-tutorial/debug_api.py | 47 ------------------ langgraph-tutorial/list_models.py | 12 ----- langgraph-tutorial/test_api.py | 13 ----- langgraph-tutorial/test_models.py | 23 --------- 5 files changed, 95 deletions(-) delete mode 100644 langgraph-tutorial/__pycache__/config.cpython-313.pyc delete mode 100644 langgraph-tutorial/debug_api.py delete mode 100644 langgraph-tutorial/list_models.py delete mode 100644 langgraph-tutorial/test_api.py delete mode 100644 langgraph-tutorial/test_models.py diff --git a/langgraph-tutorial/__pycache__/config.cpython-313.pyc b/langgraph-tutorial/__pycache__/config.cpython-313.pyc deleted file mode 100644 index 56fc2f3340324c9c30700fa681a824169bd5fa85..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 453 zcmey&%ge<81ph)rvb-1>7#@Q-FaYF(!DksDHI*Tlp@<=vv4}C4sfa0?9^l~G;{QQDqy~N_oMEx?u zDxUO$5?xb06W!d*yv&y@Kv$+4gTZBcKTWniT8Gmyv5<<80;D! z8su|})z{y})#nzUuVX~KXNYT%V~D4}U+^vN5Le#-5HB>ybtS`RPzc?!aJ7nY^o$A1 zOiFdmPsz+nkIBhTPR!9QNi8mk$w|yhPcKR=$j~h*Ey*v+Ow5T%&d*EBOxG)@yv1RY zo1apelWJGQ12hN};>8+3;sY}yBjZOVCPtPITnyX+j1BBJxK$fCZg7Y-uzp};5E5?S NyTK>e$Xx`AJph`RjfnsN diff --git a/langgraph-tutorial/debug_api.py b/langgraph-tutorial/debug_api.py deleted file mode 100644 index 5845b59..0000000 --- a/langgraph-tutorial/debug_api.py +++ /dev/null @@ -1,47 +0,0 @@ -import requests -import json - -url = "https://gw2.oops.asia/v1/chat/completions" -headers = { - "Content-Type": "application/json", - "Authorization": "Bearer sk-f5ba1acb1d61c39f754c28f19d0e6e1b7d8d9fda43ef812ce4e335b6c26eff01" -} - -# 测试不同的请求格式 -test_cases = [ - { - "name": "标准格式", - "body": { - "model": "gpt-5.4-mini", - "messages": [{"role": "user", "content": "Say hi"}], - "max_tokens": 20 - } - }, - { - "name": "带 temperature", - "body": { - "model": "gpt-5.4-mini", - "messages": [{"role": "user", "content": "Say hi"}], - "max_tokens": 20, - "temperature": 0.3 - } - }, - { - "name": "带 stream", - "body": { - "model": "gpt-5.4-mini", - "messages": [{"role": "user", "content": "Say hi"}], - "max_tokens": 20, - "stream": False - } - } -] - -for test in test_cases: - print(f"\n测试: {test['name']}") - try: - response = requests.post(url, headers=headers, json=test["body"], timeout=10) - print(f" 状态码: {response.status_code}") - print(f" 响应: {response.text[:200]}") - except Exception as e: - print(f" 错误: {e}") \ No newline at end of file diff --git a/langgraph-tutorial/list_models.py b/langgraph-tutorial/list_models.py deleted file mode 100644 index 9495681..0000000 --- a/langgraph-tutorial/list_models.py +++ /dev/null @@ -1,12 +0,0 @@ -from openai import OpenAI - -client = OpenAI( - api_key="sk-f5ba1acb1d61c39f754c28f19d0e6e1b7d8d9fda43ef812ce4e335b6c26eff01", - base_url="https://gw2.oops.asia/v1" -) - -models = client.models.list() -print("支持的模型列表:") -print("-" * 50) -for m in models: - print(f" {m.id}") \ No newline at end of file diff --git a/langgraph-tutorial/test_api.py b/langgraph-tutorial/test_api.py deleted file mode 100644 index c487ed6..0000000 --- a/langgraph-tutorial/test_api.py +++ /dev/null @@ -1,13 +0,0 @@ -from openai import OpenAI - -client = OpenAI( - api_key="sk-f5ba1acb1d61c39f754c28f19d0e6e1b7d8d9fda43ef812ce4e335b6c26eff01", - base_url="https://gw2.oops.asia/v1" -) - -response = client.chat.completions.create( - model="gpt-5.4-mini", - messages=[{"role": "user", "content": "Say hi in Chinese"}], - max_tokens=20 -) -print(response.choices[0].message.content) \ No newline at end of file diff --git a/langgraph-tutorial/test_models.py b/langgraph-tutorial/test_models.py deleted file mode 100644 index 3c7f2ae..0000000 --- a/langgraph-tutorial/test_models.py +++ /dev/null @@ -1,23 +0,0 @@ -from openai import OpenAI - -client = OpenAI( - api_key="sk-f5ba1acb1d61c39f754c28f19d0e6e1b7d8d9fda43ef812ce4e335b6c26eff01", - base_url="https://gw2.oops.asia/v1" -) - -models_to_test = ["gpt-4o-mini", "gpt-4o", "gpt-3.5-turbo", "gpt-5", "gpt-5.5", "claude-sonnet-4-20250514"] - -print("测试可用模型:") -print("-" * 50) - -for model in models_to_test: - try: - response = client.chat.completions.create( - model=model, - messages=[{"role": "user", "content": "Say hi"}], - max_tokens=20 - ) - print(f" ✅ {model} - OK") - except Exception as e: - error_msg = str(e)[:50] - print(f" ❌ {model} - {error_msg}") \ No newline at end of file