amikos-tech / chromadbx

A collection of experimental Chroma extensions.
MIT License
2 stars 0 forks source link

XAI EF #50

Open tazarov opened 1 month ago

tazarov commented 1 month ago
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())
tazarov commented 1 month ago

https://developers.x.ai/python-sdk/embedder/#embedding-from-a-model