@lunora/ai 1.0.0-alpha.18 → 1.0.0-alpha.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -149,7 +149,8 @@ const defineRag = (config) => {
149
149
  let model;
150
150
  const tracer = typeof context.trace === "function" ? context.trace : void 0;
151
151
  const embedText = async (text) => {
152
- const resolvedModel = model ??= resolveEmbeddingModel(config.embeddingModel, context.ai);
152
+ model ??= resolveEmbeddingModel(config.embeddingModel, context.ai);
153
+ const resolvedModel = model;
153
154
  const run = async () => {
154
155
  const { embedding } = await embed({ model: resolvedModel, value: text });
155
156
  return embedding;
@@ -111,7 +111,7 @@ interface RagContext {
111
111
  auth?: unknown;
112
112
  /**
113
113
  * Optional `ctx.trace` span factory — an `ActionCtx`'s `ctx.trace` satisfies
114
- * it structurally. When present, {@link defineRag} wraps each embedding-model
114
+ * it structurally. When present, `defineRag` wraps each embedding-model
115
115
  * call in a `generation` span (`gen_ai.operation.name: "embeddings"` +
116
116
  * `gen_ai.request.model`), so the embed shows up on the trace waterfall like
117
117
  * any other instrumented sub-operation. `unknown` on purpose — the same
@@ -111,7 +111,7 @@ interface RagContext {
111
111
  auth?: unknown;
112
112
  /**
113
113
  * Optional `ctx.trace` span factory — an `ActionCtx`'s `ctx.trace` satisfies
114
- * it structurally. When present, {@link defineRag} wraps each embedding-model
114
+ * it structurally. When present, `defineRag` wraps each embedding-model
115
115
  * call in a `generation` span (`gen_ai.operation.name: "embeddings"` +
116
116
  * `gen_ai.request.model`), so the embed shows up on the trace waterfall like
117
117
  * any other instrumented sub-operation. `unknown` on purpose — the same
@@ -1,5 +1,5 @@
1
1
  export { default as fixedWindowChunks } from '../packem_shared/fixedWindowChunks-J-WfQDw9.mjs';
2
- export { default as defineRag } from '../packem_shared/defineRag-CGGLJ5ax.mjs';
2
+ export { default as defineRag } from '../packem_shared/defineRag-DgVXmNGw.mjs';
3
3
  export { contentHash, guessMimeTypeFromExtension } from '../packem_shared/contentHash-Cgz5KRGD.mjs';
4
4
  export { default as hybridRank } from '../packem_shared/hybridRank-DPC9c2ON.mjs';
5
5
  export { default as bm25LexicalStore } from '../packem_shared/bm25LexicalStore-BQzWLMqX.mjs';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lunora/ai",
3
- "version": "1.0.0-alpha.18",
3
+ "version": "1.0.0-alpha.19",
4
4
  "description": "Workers AI helper for Lunora: provider-agnostic AI SDK access from functions, Workers AI by default",
5
5
  "keywords": [
6
6
  "ai",