Skip to content

XAI EF #50

@tazarov

Description

@tazarov
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())

Metadata

Metadata

Assignees

Labels

EFEmbedding Function

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions