init
This commit is contained in:
commit
2be8de47fa
87 changed files with 11501 additions and 0 deletions
18
scripts/data_generator/test_url.py
Normal file
18
scripts/data_generator/test_url.py
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
import os
|
||||
from openai import OpenAI
|
||||
|
||||
# Case 1: URL with /v1
|
||||
print("--- Case 1: /v1 ---")
|
||||
client = OpenAI(api_key="sk-test", base_url="http://127.0.0.1:8045/v1")
|
||||
try:
|
||||
client.chat.completions.create(model="test", messages=[{"role":"user","content":"hi"}])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
|
||||
# Case 2: URL without /v1 (Root)
|
||||
print("\n--- Case 2: Root ---")
|
||||
client = OpenAI(api_key="sk-test", base_url="http://127.0.0.1:8045")
|
||||
try:
|
||||
client.chat.completions.create(model="test", messages=[{"role":"user","content":"hi"}])
|
||||
except Exception as e:
|
||||
print(e)
|
||||
Loading…
Add table
Add a link
Reference in a new issue