@gammatech/aijsx 0.16.1-dev.2024-11-05 → 0.16.3-dev.2024-11-17
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/index.d.mts +5 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +24 -4
- package/dist/index.mjs +24 -4
- package/dist/{jsx-dev-runtime-yyAW1PnA.d.mts → jsx-dev-runtime-RvJm3SlM.d.mts} +8 -1
- package/dist/{jsx-dev-runtime-yyAW1PnA.d.ts → jsx-dev-runtime-RvJm3SlM.d.ts} +8 -1
- 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
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LogChatCompletionRequest, A as AINode, C as ChatCompletionUsage, R as RenderContext, a as LogImplementation, S as SpanProcessor, b as ContextValues, c as Context, T as Tracer, d as ReadableSpan, e as SpanAttributes, f as SpanExporter, g as AIComponent, P as Prompt, h as ChatCompletionRequestPayloads, D as DebugMessage, E as EvaluatorResult, i as EvaluatorFn, j as PromptParsed, J as JSX } from './jsx-dev-runtime-
|
|
2
|
-
export {
|
|
1
|
+
import { L as LogChatCompletionRequest, A as AINode, C as ChatCompletionUsage, R as RenderContext, a as LogImplementation, S as SpanProcessor, b as ContextValues, c as Context, T as Tracer, d as ReadableSpan, e as SpanAttributes, f as SpanExporter, g as AIComponent, P as Prompt, h as ChatCompletionRequestPayloads, D as DebugMessage, E as EvaluatorResult, i as EvaluatorFn, j as LlmEvaluatorFn, k as PromptParsed, J as JSX } from './jsx-dev-runtime-RvJm3SlM.mjs';
|
|
2
|
+
export { F as AIElement, m as AIFragment, B as BoundLogger, o as ChatMessage, p as ChatRole, w as CombinedLogger, v as ConsoleLogger, I as ImagePart, q as ImagePartProps, x as Literal, r as LogChatCompletionResponse, s as LogLevel, u as Logger, N as NoopLogImplementation, X as OutputParser, H as PropsOfAIComponent, y as RenderResult, G as Renderable, O as Span, K as SpanContext, Q as SpanEvent, M as SpanStatus, V as TracingContext, U as TracingContextKey, W as TracingContextManager, z as attachedContextSymbol, l as createAIElement, n as createContext, t as toDebugMessage } from './jsx-dev-runtime-RvJm3SlM.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';
|
|
@@ -210,6 +210,7 @@ declare function createPrompt<K extends string, I extends ZodObject<ZodRawShape>
|
|
|
210
210
|
schema: I;
|
|
211
211
|
component: AIComponent<z.infer<I>>;
|
|
212
212
|
evaluators?: EvaluatorFn<z.infer<I>, z.infer<O>>[];
|
|
213
|
+
llmEvaluators?: LlmEvaluatorFn<z.infer<I>, z.infer<O>>[];
|
|
213
214
|
metadata?: Record<string, any>;
|
|
214
215
|
outputParser: {
|
|
215
216
|
schema: O;
|
|
@@ -221,6 +222,7 @@ declare function createPrompt<K extends string, I extends ZodObject<ZodRawShape>
|
|
|
221
222
|
schema: I;
|
|
222
223
|
component: AIComponent<z.infer<I>>;
|
|
223
224
|
evaluators?: EvaluatorFn<z.infer<I>, string>[];
|
|
225
|
+
llmEvaluators?: LlmEvaluatorFn<z.infer<I>, string>[];
|
|
224
226
|
metadata?: Record<string, any>;
|
|
225
227
|
}): Prompt<z.infer<I>>;
|
|
226
228
|
declare function isPromptParsed<V extends Record<string, any>>(prompt: Prompt<V>): prompt is PromptParsed<any, any>;
|
|
@@ -320,4 +322,4 @@ type GoogleChatCompletionProps = {
|
|
|
320
322
|
};
|
|
321
323
|
declare function GoogleChatCompletion(props: GoogleChatCompletionProps, ctx: RenderContext): JSX.Element;
|
|
322
324
|
|
|
323
|
-
export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, Accumulate, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, AssistantMessage, type ChatCompletionClientAndProvider, ChatCompletionError, type ChatCompletionRequestPayloads, ChatCompletionUsage, Context, type CostFn, DebugMessage, DefaultMaxRetriesContext, EvaluatorFn, EvaluatorResult, Fallback, type GetChatCompletionClientAndProvider, GoogleChatCompletion, type GoogleChatCompletionRequest, GoogleClientContext, LogChatCompletionRequest, LogImplementation, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, Retry, RetryCountContext, RetryLastErrorContext, SpanAttributes, SpanExporter, SpanProcessor, SystemMessage, Trace, Tracer, UserMessage, type ValidAnthropicChatModel, type ValidGoogleChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createPrompt, createRenderContext, evaluatePrompt, AnthropicPromptCacheDebugger as experimental__AnthropicPromptCacheDebugger, isPromptParsed, tracing };
|
|
325
|
+
export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, Accumulate, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, AssistantMessage, type ChatCompletionClientAndProvider, ChatCompletionError, type ChatCompletionRequestPayloads, ChatCompletionUsage, Context, type CostFn, DebugMessage, DefaultMaxRetriesContext, EvaluatorFn, EvaluatorResult, Fallback, type GetChatCompletionClientAndProvider, GoogleChatCompletion, type GoogleChatCompletionRequest, GoogleClientContext, LlmEvaluatorFn, LogChatCompletionRequest, LogImplementation, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, Retry, RetryCountContext, RetryLastErrorContext, SpanAttributes, SpanExporter, SpanProcessor, SystemMessage, Trace, Tracer, UserMessage, type ValidAnthropicChatModel, type ValidGoogleChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createPrompt, createRenderContext, evaluatePrompt, AnthropicPromptCacheDebugger as experimental__AnthropicPromptCacheDebugger, isPromptParsed, tracing };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { L as LogChatCompletionRequest, A as AINode, C as ChatCompletionUsage, R as RenderContext, a as LogImplementation, S as SpanProcessor, b as ContextValues, c as Context, T as Tracer, d as ReadableSpan, e as SpanAttributes, f as SpanExporter, g as AIComponent, P as Prompt, h as ChatCompletionRequestPayloads, D as DebugMessage, E as EvaluatorResult, i as EvaluatorFn, j as PromptParsed, J as JSX } from './jsx-dev-runtime-
|
|
2
|
-
export {
|
|
1
|
+
import { L as LogChatCompletionRequest, A as AINode, C as ChatCompletionUsage, R as RenderContext, a as LogImplementation, S as SpanProcessor, b as ContextValues, c as Context, T as Tracer, d as ReadableSpan, e as SpanAttributes, f as SpanExporter, g as AIComponent, P as Prompt, h as ChatCompletionRequestPayloads, D as DebugMessage, E as EvaluatorResult, i as EvaluatorFn, j as LlmEvaluatorFn, k as PromptParsed, J as JSX } from './jsx-dev-runtime-RvJm3SlM.js';
|
|
2
|
+
export { F as AIElement, m as AIFragment, B as BoundLogger, o as ChatMessage, p as ChatRole, w as CombinedLogger, v as ConsoleLogger, I as ImagePart, q as ImagePartProps, x as Literal, r as LogChatCompletionResponse, s as LogLevel, u as Logger, N as NoopLogImplementation, X as OutputParser, H as PropsOfAIComponent, y as RenderResult, G as Renderable, O as Span, K as SpanContext, Q as SpanEvent, M as SpanStatus, V as TracingContext, U as TracingContextKey, W as TracingContextManager, z as attachedContextSymbol, l as createAIElement, n as createContext, t as toDebugMessage } from './jsx-dev-runtime-RvJm3SlM.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';
|
|
@@ -210,6 +210,7 @@ declare function createPrompt<K extends string, I extends ZodObject<ZodRawShape>
|
|
|
210
210
|
schema: I;
|
|
211
211
|
component: AIComponent<z.infer<I>>;
|
|
212
212
|
evaluators?: EvaluatorFn<z.infer<I>, z.infer<O>>[];
|
|
213
|
+
llmEvaluators?: LlmEvaluatorFn<z.infer<I>, z.infer<O>>[];
|
|
213
214
|
metadata?: Record<string, any>;
|
|
214
215
|
outputParser: {
|
|
215
216
|
schema: O;
|
|
@@ -221,6 +222,7 @@ declare function createPrompt<K extends string, I extends ZodObject<ZodRawShape>
|
|
|
221
222
|
schema: I;
|
|
222
223
|
component: AIComponent<z.infer<I>>;
|
|
223
224
|
evaluators?: EvaluatorFn<z.infer<I>, string>[];
|
|
225
|
+
llmEvaluators?: LlmEvaluatorFn<z.infer<I>, string>[];
|
|
224
226
|
metadata?: Record<string, any>;
|
|
225
227
|
}): Prompt<z.infer<I>>;
|
|
226
228
|
declare function isPromptParsed<V extends Record<string, any>>(prompt: Prompt<V>): prompt is PromptParsed<any, any>;
|
|
@@ -320,4 +322,4 @@ type GoogleChatCompletionProps = {
|
|
|
320
322
|
};
|
|
321
323
|
declare function GoogleChatCompletion(props: GoogleChatCompletionProps, ctx: RenderContext): JSX.Element;
|
|
322
324
|
|
|
323
|
-
export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, Accumulate, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, AssistantMessage, type ChatCompletionClientAndProvider, ChatCompletionError, type ChatCompletionRequestPayloads, ChatCompletionUsage, Context, type CostFn, DebugMessage, DefaultMaxRetriesContext, EvaluatorFn, EvaluatorResult, Fallback, type GetChatCompletionClientAndProvider, GoogleChatCompletion, type GoogleChatCompletionRequest, GoogleClientContext, LogChatCompletionRequest, LogImplementation, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, Retry, RetryCountContext, RetryLastErrorContext, SpanAttributes, SpanExporter, SpanProcessor, SystemMessage, Trace, Tracer, UserMessage, type ValidAnthropicChatModel, type ValidGoogleChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createPrompt, createRenderContext, evaluatePrompt, AnthropicPromptCacheDebugger as experimental__AnthropicPromptCacheDebugger, isPromptParsed, tracing };
|
|
325
|
+
export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, Accumulate, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, AssistantMessage, type ChatCompletionClientAndProvider, ChatCompletionError, type ChatCompletionRequestPayloads, ChatCompletionUsage, Context, type CostFn, DebugMessage, DefaultMaxRetriesContext, EvaluatorFn, EvaluatorResult, Fallback, type GetChatCompletionClientAndProvider, GoogleChatCompletion, type GoogleChatCompletionRequest, GoogleClientContext, LlmEvaluatorFn, LogChatCompletionRequest, LogImplementation, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, Retry, RetryCountContext, RetryLastErrorContext, SpanAttributes, SpanExporter, SpanProcessor, SystemMessage, Trace, Tracer, UserMessage, type ValidAnthropicChatModel, type ValidGoogleChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createPrompt, createRenderContext, evaluatePrompt, AnthropicPromptCacheDebugger as experimental__AnthropicPromptCacheDebugger, isPromptParsed, tracing };
|
package/dist/index.js
CHANGED
|
@@ -82,6 +82,9 @@ var ChatCompletionError = class extends Error {
|
|
|
82
82
|
this.status = status;
|
|
83
83
|
this.shouldRetry = shouldRetry4;
|
|
84
84
|
this.originalError = originalError;
|
|
85
|
+
if (originalError?.stack) {
|
|
86
|
+
this.stack = originalError.stack;
|
|
87
|
+
}
|
|
85
88
|
}
|
|
86
89
|
name = "ChatCompletionError";
|
|
87
90
|
};
|
|
@@ -1983,6 +1986,7 @@ function createPrompt(config) {
|
|
|
1983
1986
|
outputParser,
|
|
1984
1987
|
component: component2,
|
|
1985
1988
|
evaluators: evaluators2 = [],
|
|
1989
|
+
llmEvaluators: llmEvaluators2 = [],
|
|
1986
1990
|
metadata: metadata2 = {}
|
|
1987
1991
|
} = config;
|
|
1988
1992
|
return {
|
|
@@ -1992,16 +1996,25 @@ function createPrompt(config) {
|
|
|
1992
1996
|
outputSchema: outputParser.schema,
|
|
1993
1997
|
schema: schema2,
|
|
1994
1998
|
metadata: metadata2,
|
|
1995
|
-
evaluators: evaluators2
|
|
1999
|
+
evaluators: evaluators2,
|
|
2000
|
+
llmEvaluators: llmEvaluators2
|
|
1996
2001
|
};
|
|
1997
2002
|
}
|
|
1998
|
-
const {
|
|
2003
|
+
const {
|
|
2004
|
+
key,
|
|
2005
|
+
schema,
|
|
2006
|
+
component,
|
|
2007
|
+
evaluators = [],
|
|
2008
|
+
llmEvaluators = [],
|
|
2009
|
+
metadata = {}
|
|
2010
|
+
} = config;
|
|
1999
2011
|
return {
|
|
2000
2012
|
key,
|
|
2001
2013
|
component,
|
|
2002
2014
|
schema,
|
|
2003
2015
|
metadata,
|
|
2004
2016
|
evaluators,
|
|
2017
|
+
llmEvaluators,
|
|
2005
2018
|
outputSchema: import_zod.z.string()
|
|
2006
2019
|
};
|
|
2007
2020
|
}
|
|
@@ -2617,12 +2630,19 @@ async function* AnthropicChatCompletionInner(props, ctx) {
|
|
|
2617
2630
|
`AnthropicClient.APIError: ${err.message}`,
|
|
2618
2631
|
logRequestData,
|
|
2619
2632
|
status,
|
|
2620
|
-
retry
|
|
2633
|
+
retry,
|
|
2634
|
+
err
|
|
2621
2635
|
);
|
|
2622
2636
|
} else if (err instanceof Error) {
|
|
2623
2637
|
const status = extractStatusFromError2(err);
|
|
2624
2638
|
const retry = shouldRetryFromStatus(status);
|
|
2625
|
-
throw new ChatCompletionError(
|
|
2639
|
+
throw new ChatCompletionError(
|
|
2640
|
+
err.message,
|
|
2641
|
+
logRequestData,
|
|
2642
|
+
status,
|
|
2643
|
+
retry,
|
|
2644
|
+
err
|
|
2645
|
+
);
|
|
2626
2646
|
}
|
|
2627
2647
|
throw err;
|
|
2628
2648
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -14,6 +14,9 @@ var ChatCompletionError = class extends Error {
|
|
|
14
14
|
this.status = status;
|
|
15
15
|
this.shouldRetry = shouldRetry4;
|
|
16
16
|
this.originalError = originalError;
|
|
17
|
+
if (originalError?.stack) {
|
|
18
|
+
this.stack = originalError.stack;
|
|
19
|
+
}
|
|
17
20
|
}
|
|
18
21
|
name = "ChatCompletionError";
|
|
19
22
|
};
|
|
@@ -1882,6 +1885,7 @@ function createPrompt(config) {
|
|
|
1882
1885
|
outputParser,
|
|
1883
1886
|
component: component2,
|
|
1884
1887
|
evaluators: evaluators2 = [],
|
|
1888
|
+
llmEvaluators: llmEvaluators2 = [],
|
|
1885
1889
|
metadata: metadata2 = {}
|
|
1886
1890
|
} = config;
|
|
1887
1891
|
return {
|
|
@@ -1891,16 +1895,25 @@ function createPrompt(config) {
|
|
|
1891
1895
|
outputSchema: outputParser.schema,
|
|
1892
1896
|
schema: schema2,
|
|
1893
1897
|
metadata: metadata2,
|
|
1894
|
-
evaluators: evaluators2
|
|
1898
|
+
evaluators: evaluators2,
|
|
1899
|
+
llmEvaluators: llmEvaluators2
|
|
1895
1900
|
};
|
|
1896
1901
|
}
|
|
1897
|
-
const {
|
|
1902
|
+
const {
|
|
1903
|
+
key,
|
|
1904
|
+
schema,
|
|
1905
|
+
component,
|
|
1906
|
+
evaluators = [],
|
|
1907
|
+
llmEvaluators = [],
|
|
1908
|
+
metadata = {}
|
|
1909
|
+
} = config;
|
|
1898
1910
|
return {
|
|
1899
1911
|
key,
|
|
1900
1912
|
component,
|
|
1901
1913
|
schema,
|
|
1902
1914
|
metadata,
|
|
1903
1915
|
evaluators,
|
|
1916
|
+
llmEvaluators,
|
|
1904
1917
|
outputSchema: z.string()
|
|
1905
1918
|
};
|
|
1906
1919
|
}
|
|
@@ -2516,12 +2529,19 @@ async function* AnthropicChatCompletionInner(props, ctx) {
|
|
|
2516
2529
|
`AnthropicClient.APIError: ${err.message}`,
|
|
2517
2530
|
logRequestData,
|
|
2518
2531
|
status,
|
|
2519
|
-
retry
|
|
2532
|
+
retry,
|
|
2533
|
+
err
|
|
2520
2534
|
);
|
|
2521
2535
|
} else if (err instanceof Error) {
|
|
2522
2536
|
const status = extractStatusFromError2(err);
|
|
2523
2537
|
const retry = shouldRetryFromStatus(status);
|
|
2524
|
-
throw new ChatCompletionError(
|
|
2538
|
+
throw new ChatCompletionError(
|
|
2539
|
+
err.message,
|
|
2540
|
+
logRequestData,
|
|
2541
|
+
status,
|
|
2542
|
+
retry,
|
|
2543
|
+
err
|
|
2544
|
+
);
|
|
2525
2545
|
}
|
|
2526
2546
|
throw err;
|
|
2527
2547
|
}
|
|
@@ -102,10 +102,16 @@ type EvaluatorResult = {
|
|
|
102
102
|
key: string;
|
|
103
103
|
result: EvaluatorPrimitive | EvaluatorPrimitive[];
|
|
104
104
|
passes: boolean;
|
|
105
|
+
score?: number;
|
|
105
106
|
description?: string;
|
|
106
107
|
debug?: string;
|
|
107
108
|
};
|
|
108
109
|
type EvaluatorFn<V extends Record<string, any> = Record<string, any>, O = any> = (variables: V, result: O) => Promise<EvaluatorResult | EvaluatorResult[]>;
|
|
110
|
+
type LlmEvaluatorFn<V extends Record<string, any> = Record<string, any>, O = any> = (ctx: RenderContext, options: {
|
|
111
|
+
variables: V;
|
|
112
|
+
output: O;
|
|
113
|
+
expected?: O;
|
|
114
|
+
}) => Promise<EvaluatorResult | EvaluatorResult[]>;
|
|
109
115
|
type OutputParser<O> = {
|
|
110
116
|
schema: ZodTypeAny;
|
|
111
117
|
parse: (result: string) => O;
|
|
@@ -115,6 +121,7 @@ interface Prompt<V extends Record<string, any> = Record<string, any>> {
|
|
|
115
121
|
component: AIComponent<V>;
|
|
116
122
|
schema: ZodObject<ZodRawShape>;
|
|
117
123
|
evaluators: EvaluatorFn<V>[];
|
|
124
|
+
llmEvaluators: LlmEvaluatorFn<V>[];
|
|
118
125
|
outputSchema: ZodTypeAny;
|
|
119
126
|
metadata: Record<string, any>;
|
|
120
127
|
}
|
|
@@ -362,4 +369,4 @@ declare const jsxs: typeof jsx;
|
|
|
362
369
|
/** @hidden */
|
|
363
370
|
declare const Fragment: typeof AIFragment;
|
|
364
371
|
|
|
365
|
-
export { type AINode as A, BoundLogger as B, type ChatCompletionUsage as C, type DebugMessage as D, type EvaluatorResult as E, type
|
|
372
|
+
export { Fragment as $, type AINode as A, BoundLogger as B, type ChatCompletionUsage as C, type DebugMessage as D, type EvaluatorResult as E, type AIElement as F, type Renderable as G, type PropsOfAIComponent as H, ImagePart as I, JSX as J, type SpanContext as K, type LogChatCompletionRequest as L, type SpanStatus as M, NoopLogImplementation as N, type Span as O, type Prompt as P, type SpanEvent as Q, type RenderContext as R, type SpanProcessor as S, type Tracer as T, type TracingContextKey as U, type TracingContext as V, type TracingContextManager as W, type OutputParser as X, jsx as Y, jsxDEV as Z, jsxs as _, LogImplementation as a, type ContextValues as b, type Context as c, type ReadableSpan as d, type SpanAttributes as e, type SpanExporter as f, type AIComponent as g, type ChatCompletionRequestPayloads as h, type EvaluatorFn as i, type LlmEvaluatorFn as j, type PromptParsed as k, createAIElement as l, AIFragment as m, createContext as n, type ChatMessage as o, type ChatRole as p, type ImagePartProps as q, type LogChatCompletionResponse as r, type LogLevel as s, toDebugMessage as t, type Logger as u, ConsoleLogger as v, CombinedLogger as w, type Literal as x, type RenderResult as y, attachedContextSymbol as z };
|
|
@@ -102,10 +102,16 @@ type EvaluatorResult = {
|
|
|
102
102
|
key: string;
|
|
103
103
|
result: EvaluatorPrimitive | EvaluatorPrimitive[];
|
|
104
104
|
passes: boolean;
|
|
105
|
+
score?: number;
|
|
105
106
|
description?: string;
|
|
106
107
|
debug?: string;
|
|
107
108
|
};
|
|
108
109
|
type EvaluatorFn<V extends Record<string, any> = Record<string, any>, O = any> = (variables: V, result: O) => Promise<EvaluatorResult | EvaluatorResult[]>;
|
|
110
|
+
type LlmEvaluatorFn<V extends Record<string, any> = Record<string, any>, O = any> = (ctx: RenderContext, options: {
|
|
111
|
+
variables: V;
|
|
112
|
+
output: O;
|
|
113
|
+
expected?: O;
|
|
114
|
+
}) => Promise<EvaluatorResult | EvaluatorResult[]>;
|
|
109
115
|
type OutputParser<O> = {
|
|
110
116
|
schema: ZodTypeAny;
|
|
111
117
|
parse: (result: string) => O;
|
|
@@ -115,6 +121,7 @@ interface Prompt<V extends Record<string, any> = Record<string, any>> {
|
|
|
115
121
|
component: AIComponent<V>;
|
|
116
122
|
schema: ZodObject<ZodRawShape>;
|
|
117
123
|
evaluators: EvaluatorFn<V>[];
|
|
124
|
+
llmEvaluators: LlmEvaluatorFn<V>[];
|
|
118
125
|
outputSchema: ZodTypeAny;
|
|
119
126
|
metadata: Record<string, any>;
|
|
120
127
|
}
|
|
@@ -362,4 +369,4 @@ declare const jsxs: typeof jsx;
|
|
|
362
369
|
/** @hidden */
|
|
363
370
|
declare const Fragment: typeof AIFragment;
|
|
364
371
|
|
|
365
|
-
export { type AINode as A, BoundLogger as B, type ChatCompletionUsage as C, type DebugMessage as D, type EvaluatorResult as E, type
|
|
372
|
+
export { Fragment as $, type AINode as A, BoundLogger as B, type ChatCompletionUsage as C, type DebugMessage as D, type EvaluatorResult as E, type AIElement as F, type Renderable as G, type PropsOfAIComponent as H, ImagePart as I, JSX as J, type SpanContext as K, type LogChatCompletionRequest as L, type SpanStatus as M, NoopLogImplementation as N, type Span as O, type Prompt as P, type SpanEvent as Q, type RenderContext as R, type SpanProcessor as S, type Tracer as T, type TracingContextKey as U, type TracingContext as V, type TracingContextManager as W, type OutputParser as X, jsx as Y, jsxDEV as Z, jsxs as _, LogImplementation as a, type ContextValues as b, type Context as c, type ReadableSpan as d, type SpanAttributes as e, type SpanExporter as f, type AIComponent as g, type ChatCompletionRequestPayloads as h, type EvaluatorFn as i, type LlmEvaluatorFn as j, type PromptParsed as k, createAIElement as l, AIFragment as m, createContext as n, type ChatMessage as o, type ChatRole as p, type ImagePartProps as q, type LogChatCompletionResponse as r, type LogLevel as s, toDebugMessage as t, type Logger as u, ConsoleLogger as v, CombinedLogger as w, type Literal as x, type RenderResult as y, attachedContextSymbol as z };
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { $ as Fragment, J as JSX, Y as jsx, Z as jsxDEV, _ as jsxs } from './jsx-dev-runtime-RvJm3SlM.mjs';
|
|
2
2
|
import 'zod';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { $ as Fragment, J as JSX, Y as jsx, Z as jsxDEV, _ as jsxs } from './jsx-dev-runtime-RvJm3SlM.js';
|
|
2
2
|
import 'zod';
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { $ as Fragment, J as JSX, Y as jsx, Z as jsxDEV, _ as jsxs } from './jsx-dev-runtime-RvJm3SlM.mjs';
|
|
2
2
|
import 'zod';
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { $ as Fragment, J as JSX, Y as jsx, Z as jsxDEV, _ as jsxs } from './jsx-dev-runtime-RvJm3SlM.js';
|
|
2
2
|
import 'zod';
|