import asyncio
import xai_sdk
async def main():
client = xai_sdk.Client(api_key="YOUR_API_KEY", api_host="api.x.ai")
prompts = [
"This is a crazy promotion for a new product.",
"This is not a crazy promotion"
]
async for embedding in client.embedder.embed(texts=prompts, model_name="spam"):
print(embedding)
asyncio.run(main())