Prerequisites
Install the Tracia SDK and the provider package(s) you need:.env
Single Text Embedding
Pass a string toinput to embed a single piece of text:
Batch Embedding
Pass an array of strings to embed multiple texts in a single request:Batch embedding is more efficient than making separate requests for each text. The provider processes all inputs in a single API call.
Specifying Dimensions
Some models support reducing the embedding dimensions. This is useful for saving storage space or improving retrieval speed:Using with Sessions
Sessions automatically chain embedding spans with other spans under the same trace:traceId and parentSpanId automatically, so all spans appear in sequence in the Tracia dashboard.

