@gammatech/aijsx 0.4.1-beta.3 → 0.4.1-beta.4
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.
- package/dist/{createElement-elCDOGhR.d.mts → createElement-x4FT7ZgG.d.mts} +1 -1
- package/dist/{createElement-elCDOGhR.d.ts → createElement-x4FT7ZgG.d.ts} +1 -1
- package/dist/index.d.mts +10 -3
- package/dist/index.d.ts +10 -3
- package/dist/index.js +10 -0
- package/dist/index.mjs +9 -0
- package/dist/jsx-dev-runtime.d.mts +1 -1
- package/dist/jsx-dev-runtime.d.ts +1 -1
- package/dist/jsx-runtime.d.mts +1 -1
- package/dist/jsx-runtime.d.ts +1 -1
- package/package.json +1 -1
|
@@ -318,4 +318,4 @@ declare function AIFragment({ children }: {
|
|
|
318
318
|
children: AINode;
|
|
319
319
|
}): Renderable;
|
|
320
320
|
|
|
321
|
-
export { type AIComponent as A, BoundLogger as B, type ContextValues as C,
|
|
321
|
+
export { type AIComponent as A, BoundLogger as B, type ContextValues as C, type RenderResult as D, type EvaluatorFn as E, type FunctionChain as F, attachedContextSymbol as G, type AIElement as H, type Renderable as I, type PropsOfAIComponent as J, type SpanContext as K, LogImplementation as L, type SpanStatus as M, type NotAsyncGenerator as N, type Span as O, type PromptParsed as P, type SpanEvent as Q, type RenderContext as R, type SpanProcessor as S, type Tracer as T, UserMessage as U, type TracingContextKey as V, type TracingContext as W, type TracingContextManager as X, type OutputParser as Y, type ReadableSpan as a, type SpanExporter as b, type AINode as c, type SpanAttributes as d, type Prompt as e, type StreamChain as f, type EvaluatorResult as g, type Context as h, createAIElement as i, AIFragment as j, createContext as k, type ChatCompletionRole as l, SystemMessage as m, AssistantMessage as n, type RenderedConversationMessage as o, computeUsage as p, ChatCompletionError as q, type ChatCompletionRequestPayloads as r, type LogChatCompletionRequest as s, type LogChatCompletionResponse as t, type LogLevel as u, type Logger as v, NoopLogImplementation as w, ConsoleLogger as x, CombinedLogger as y, type Literal as z };
|
|
@@ -318,4 +318,4 @@ declare function AIFragment({ children }: {
|
|
|
318
318
|
children: AINode;
|
|
319
319
|
}): Renderable;
|
|
320
320
|
|
|
321
|
-
export { type AIComponent as A, BoundLogger as B, type ContextValues as C,
|
|
321
|
+
export { type AIComponent as A, BoundLogger as B, type ContextValues as C, type RenderResult as D, type EvaluatorFn as E, type FunctionChain as F, attachedContextSymbol as G, type AIElement as H, type Renderable as I, type PropsOfAIComponent as J, type SpanContext as K, LogImplementation as L, type SpanStatus as M, type NotAsyncGenerator as N, type Span as O, type PromptParsed as P, type SpanEvent as Q, type RenderContext as R, type SpanProcessor as S, type Tracer as T, UserMessage as U, type TracingContextKey as V, type TracingContext as W, type TracingContextManager as X, type OutputParser as Y, type ReadableSpan as a, type SpanExporter as b, type AINode as c, type SpanAttributes as d, type Prompt as e, type StreamChain as f, type EvaluatorResult as g, type Context as h, createAIElement as i, AIFragment as j, createContext as k, type ChatCompletionRole as l, SystemMessage as m, AssistantMessage as n, type RenderedConversationMessage as o, computeUsage as p, ChatCompletionError as q, type ChatCompletionRequestPayloads as r, type LogChatCompletionRequest as s, type LogChatCompletionResponse as t, type LogLevel as u, type Logger as v, NoopLogImplementation as w, ConsoleLogger as x, CombinedLogger as y, type Literal as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderContext, L as LogImplementation, S as SpanProcessor, C as ContextValues, T as Tracer, a as ReadableSpan, b as SpanExporter, A as AIComponent, E as EvaluatorFn, P as PromptParsed,
|
|
2
|
-
export {
|
|
1
|
+
import { R as RenderContext, L as LogImplementation, S as SpanProcessor, C as ContextValues, T as Tracer, a as ReadableSpan, b as SpanExporter, A as AIComponent, c as AINode, d as SpanAttributes, E as EvaluatorFn, P as PromptParsed, e as Prompt, N as NotAsyncGenerator, F as FunctionChain, f as StreamChain, g as EvaluatorResult, h as Context } from './createElement-x4FT7ZgG.mjs';
|
|
2
|
+
export { H as AIElement, j as AIFragment, n as AssistantMessage, B as BoundLogger, q as ChatCompletionError, r as ChatCompletionRequestPayloads, l as ChatCompletionRole, y as CombinedLogger, x as ConsoleLogger, z as Literal, s as LogChatCompletionRequest, t as LogChatCompletionResponse, u as LogLevel, v as Logger, w as NoopLogImplementation, Y as OutputParser, J as PropsOfAIComponent, D as RenderResult, I as Renderable, o as RenderedConversationMessage, O as Span, K as SpanContext, Q as SpanEvent, M as SpanStatus, m as SystemMessage, W as TracingContext, V as TracingContextKey, X as TracingContextManager, U as UserMessage, G as attachedContextSymbol, p as computeUsage, i as createAIElement, k as createContext } from './createElement-x4FT7ZgG.mjs';
|
|
3
3
|
import { ZodObject, ZodRawShape, ZodTypeAny, ZodString, z } from 'zod';
|
|
4
4
|
import { OpenAI } from 'openai';
|
|
5
5
|
export { OpenAI as OpenAIClient } from 'openai';
|
|
@@ -81,6 +81,13 @@ declare class AISpanProcessor extends EnrichingSpanProcessor {
|
|
|
81
81
|
protected evaluatePrompt(span: ReadableSpan): Promise<ReadableSpan>;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
type TraceProps = {
|
|
85
|
+
children: AINode;
|
|
86
|
+
name: string;
|
|
87
|
+
attributes?: SpanAttributes;
|
|
88
|
+
};
|
|
89
|
+
declare const Trace: AIComponent<TraceProps>;
|
|
90
|
+
|
|
84
91
|
/**
|
|
85
92
|
* This is a helper function to create a JsxPrompt type
|
|
86
93
|
*/
|
|
@@ -200,4 +207,4 @@ type AnthropicChatCompletionProps = {
|
|
|
200
207
|
*/
|
|
201
208
|
declare function AnthropicChatCompletion(props: AnthropicChatCompletionProps, { render, logger, tracer, getContext }: RenderContext): AsyncGenerator<string, void, unknown>;
|
|
202
209
|
|
|
203
|
-
export { AIComponent, AINode, AISpanProcessor, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, ContentTypeImage, Context, type CostFn, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, FunctionChain, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, OpenAIVisionChatCompletion, ParseVariablesError, Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, SpanExporter, SpanProcessor, StreamChain, Tracer, type ValidAnthropicChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, tokenCountForOpenAIMessage, tokenCountForOpenAIVisionMessage, tokenLimitForChatModel, tokenizer, tracing };
|
|
210
|
+
export { AIComponent, AINode, AISpanProcessor, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, ContentTypeImage, Context, type CostFn, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, FunctionChain, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, OpenAIVisionChatCompletion, ParseVariablesError, Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, SpanAttributes, SpanExporter, SpanProcessor, StreamChain, Trace, Tracer, type ValidAnthropicChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, tokenCountForOpenAIMessage, tokenCountForOpenAIVisionMessage, tokenLimitForChatModel, tokenizer, tracing };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderContext, L as LogImplementation, S as SpanProcessor, C as ContextValues, T as Tracer, a as ReadableSpan, b as SpanExporter, A as AIComponent, E as EvaluatorFn, P as PromptParsed,
|
|
2
|
-
export {
|
|
1
|
+
import { R as RenderContext, L as LogImplementation, S as SpanProcessor, C as ContextValues, T as Tracer, a as ReadableSpan, b as SpanExporter, A as AIComponent, c as AINode, d as SpanAttributes, E as EvaluatorFn, P as PromptParsed, e as Prompt, N as NotAsyncGenerator, F as FunctionChain, f as StreamChain, g as EvaluatorResult, h as Context } from './createElement-x4FT7ZgG.js';
|
|
2
|
+
export { H as AIElement, j as AIFragment, n as AssistantMessage, B as BoundLogger, q as ChatCompletionError, r as ChatCompletionRequestPayloads, l as ChatCompletionRole, y as CombinedLogger, x as ConsoleLogger, z as Literal, s as LogChatCompletionRequest, t as LogChatCompletionResponse, u as LogLevel, v as Logger, w as NoopLogImplementation, Y as OutputParser, J as PropsOfAIComponent, D as RenderResult, I as Renderable, o as RenderedConversationMessage, O as Span, K as SpanContext, Q as SpanEvent, M as SpanStatus, m as SystemMessage, W as TracingContext, V as TracingContextKey, X as TracingContextManager, U as UserMessage, G as attachedContextSymbol, p as computeUsage, i as createAIElement, k as createContext } from './createElement-x4FT7ZgG.js';
|
|
3
3
|
import { ZodObject, ZodRawShape, ZodTypeAny, ZodString, z } from 'zod';
|
|
4
4
|
import { OpenAI } from 'openai';
|
|
5
5
|
export { OpenAI as OpenAIClient } from 'openai';
|
|
@@ -81,6 +81,13 @@ declare class AISpanProcessor extends EnrichingSpanProcessor {
|
|
|
81
81
|
protected evaluatePrompt(span: ReadableSpan): Promise<ReadableSpan>;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
|
+
type TraceProps = {
|
|
85
|
+
children: AINode;
|
|
86
|
+
name: string;
|
|
87
|
+
attributes?: SpanAttributes;
|
|
88
|
+
};
|
|
89
|
+
declare const Trace: AIComponent<TraceProps>;
|
|
90
|
+
|
|
84
91
|
/**
|
|
85
92
|
* This is a helper function to create a JsxPrompt type
|
|
86
93
|
*/
|
|
@@ -200,4 +207,4 @@ type AnthropicChatCompletionProps = {
|
|
|
200
207
|
*/
|
|
201
208
|
declare function AnthropicChatCompletion(props: AnthropicChatCompletionProps, { render, logger, tracer, getContext }: RenderContext): AsyncGenerator<string, void, unknown>;
|
|
202
209
|
|
|
203
|
-
export { AIComponent, AINode, AISpanProcessor, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, ContentTypeImage, Context, type CostFn, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, FunctionChain, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, OpenAIVisionChatCompletion, ParseVariablesError, Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, SpanExporter, SpanProcessor, StreamChain, Tracer, type ValidAnthropicChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, tokenCountForOpenAIMessage, tokenCountForOpenAIVisionMessage, tokenLimitForChatModel, tokenizer, tracing };
|
|
210
|
+
export { AIComponent, AINode, AISpanProcessor, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, ContentTypeImage, Context, type CostFn, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, FunctionChain, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, OpenAIVisionChatCompletion, ParseVariablesError, Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, SpanAttributes, SpanExporter, SpanProcessor, StreamChain, Trace, Tracer, type ValidAnthropicChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, tokenCountForOpenAIMessage, tokenCountForOpenAIVisionMessage, tokenLimitForChatModel, tokenizer, tracing };
|
package/dist/index.js
CHANGED
|
@@ -50,6 +50,7 @@ __export(src_exports, {
|
|
|
50
50
|
ParseVariablesError: () => ParseVariablesError,
|
|
51
51
|
PromptInvalidOutputError: () => PromptInvalidOutputError,
|
|
52
52
|
SystemMessage: () => SystemMessage,
|
|
53
|
+
Trace: () => Trace,
|
|
53
54
|
UserMessage: () => UserMessage,
|
|
54
55
|
attachedContextSymbol: () => attachedContextSymbol,
|
|
55
56
|
computeUsage: () => computeUsage,
|
|
@@ -1567,6 +1568,14 @@ var isPrompt2 = (value) => {
|
|
|
1567
1568
|
);
|
|
1568
1569
|
};
|
|
1569
1570
|
|
|
1571
|
+
// src/tracing/Trace.tsx
|
|
1572
|
+
var Trace = ({ name, attributes, children }, { tracer, render }) => {
|
|
1573
|
+
const result = tracer.trace(name, attributes || {}, () => {
|
|
1574
|
+
return render(children);
|
|
1575
|
+
});
|
|
1576
|
+
return result;
|
|
1577
|
+
};
|
|
1578
|
+
|
|
1570
1579
|
// src/prompt/createPrompt.tsx
|
|
1571
1580
|
var import_zod = require("zod");
|
|
1572
1581
|
function createPrompt(config) {
|
|
@@ -2277,6 +2286,7 @@ var import_tokenizer4 = require("@anthropic-ai/tokenizer");
|
|
|
2277
2286
|
ParseVariablesError,
|
|
2278
2287
|
PromptInvalidOutputError,
|
|
2279
2288
|
SystemMessage,
|
|
2289
|
+
Trace,
|
|
2280
2290
|
UserMessage,
|
|
2281
2291
|
attachedContextSymbol,
|
|
2282
2292
|
computeUsage,
|
package/dist/index.mjs
CHANGED
|
@@ -1471,6 +1471,14 @@ var isPrompt2 = (value) => {
|
|
|
1471
1471
|
);
|
|
1472
1472
|
};
|
|
1473
1473
|
|
|
1474
|
+
// src/tracing/Trace.tsx
|
|
1475
|
+
var Trace = ({ name, attributes, children }, { tracer, render }) => {
|
|
1476
|
+
const result = tracer.trace(name, attributes || {}, () => {
|
|
1477
|
+
return render(children);
|
|
1478
|
+
});
|
|
1479
|
+
return result;
|
|
1480
|
+
};
|
|
1481
|
+
|
|
1474
1482
|
// src/prompt/createPrompt.tsx
|
|
1475
1483
|
import { z } from "zod";
|
|
1476
1484
|
function createPrompt(config) {
|
|
@@ -2180,6 +2188,7 @@ export {
|
|
|
2180
2188
|
ParseVariablesError,
|
|
2181
2189
|
PromptInvalidOutputError,
|
|
2182
2190
|
SystemMessage,
|
|
2191
|
+
Trace,
|
|
2183
2192
|
UserMessage,
|
|
2184
2193
|
attachedContextSymbol,
|
|
2185
2194
|
computeUsage,
|
package/dist/jsx-runtime.d.mts
CHANGED
package/dist/jsx-runtime.d.ts
CHANGED