|
@@ -1,28 +0,0 @@
|
|
|
-import os
|
|
|
|
|
-import asyncio
|
|
|
|
|
-from openai import AsyncOpenAI
|
|
|
|
|
-from dotenv import load_dotenv
|
|
|
|
|
-
|
|
|
|
|
-load_dotenv()
|
|
|
|
|
-
|
|
|
|
|
-async def test():
|
|
|
|
|
- client = AsyncOpenAI(
|
|
|
|
|
- api_key=os.getenv("ANTHROPIC_API_KEY"),
|
|
|
|
|
- base_url="https://imds.ai/v1"
|
|
|
|
|
- )
|
|
|
|
|
- models = ["gpt-4o", "claude-3.5-sonnet", "claude-3-5-sonnet-20240620"]
|
|
|
|
|
-
|
|
|
|
|
- for model in models:
|
|
|
|
|
- print(f"\nTesting OpenAI-Compat Model: {model}")
|
|
|
|
|
- try:
|
|
|
|
|
- response = await client.chat.completions.create(
|
|
|
|
|
- model=model,
|
|
|
|
|
- max_tokens=10,
|
|
|
|
|
- messages=[{"role": "user", "content": "hi"}]
|
|
|
|
|
- )
|
|
|
|
|
- print("Success:", response.choices[0].message.content)
|
|
|
|
|
- except Exception as e:
|
|
|
|
|
- print("Error:", repr(e))
|
|
|
|
|
-
|
|
|
|
|
-if __name__ == "__main__":
|
|
|
|
|
- asyncio.run(test())
|
|
|