mirror of
https://github.com/wassname/openrouter-python-sdk-retry-errors.git
synced 2026-08-01 12:40:23 +08:00
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
dependencies = [
|
||||
"openrouter",
|
||||
"os",
|
||||
"asyncio",
|
||||
]
|
||||
|
||||
import os
|
||||
import asyncio
|
||||
from openrouter import OpenRouter
|
||||
|
||||
async def main():
|
||||
sdk = OpenRouter(
|
||||
api_key=os.getenv("OPENROUTER_API_KEY"),
|
||||
)
|
||||
result = await sdk.chat.complete_async(
|
||||
messages=[
|
||||
{"role": "user", "content": "Hello, world!"},
|
||||
],
|
||||
model="openai/gpt-3.5-turbo",
|
||||
)
|
||||
print("Basic async completion:", result)
|
||||
|
||||
if __name__ == "__main__":
|
||||
asyncio.run(main())
|
||||
Reference in New Issue
Block a user