@gammatech/aijsx 0.3.0-beta.4 → 0.3.0-beta.5
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-Mo9PV8GD.d.mts → createElement-_dIoXoIE.d.mts} +2 -1
- package/dist/{createElement-Mo9PV8GD.d.ts → createElement-_dIoXoIE.d.ts} +2 -1
- package/dist/index.d.mts +4 -3
- package/dist/index.d.ts +4 -3
- package/dist/index.js +4 -2
- package/dist/index.mjs +4 -2
- 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
|
@@ -66,6 +66,7 @@ type Chain<V extends Record<string, any> = Record<string, any>, R = any> = {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
declare const LoggerContext: Context<LogImplementation>;
|
|
69
|
+
type ContextValues = Record<symbol, any>;
|
|
69
70
|
type RenderOptions = {
|
|
70
71
|
preserveTags?: boolean;
|
|
71
72
|
renderedProps?: {
|
|
@@ -201,4 +202,4 @@ declare function AIFragment({ children }: {
|
|
|
201
202
|
children: AINode;
|
|
202
203
|
}): Renderable;
|
|
203
204
|
|
|
204
|
-
export { type AINode as A, BoundLogger as B, type
|
|
205
|
+
export { type AINode as A, BoundLogger as B, type ContextValues as C, type PropsOfAIComponent as D, type EvaluatorFn as E, type EvaluatorResult as F, type PromptRenderResult as G, LogImplementation as L, NoopLogImplementation as N, type OutputParser as O, type PromptParsed as P, type RenderContext as R, SystemMessage as S, UserMessage as U, type Context as a, type AIComponent as b, type Prompt as c, type Chain as d, createAIElement as e, AIFragment as f, LoggerContext as g, createContext as h, type ChatCompletionRole as i, AssistantMessage as j, type RenderedConversationMessage as k, computeUsage as l, ChatCompletionError as m, type ChatCompletionRequestPayloads as n, type LogChatCompletionRequest as o, type LogChatCompletionResponse as p, type LogLevel as q, type Logger as r, ConsoleLogger as s, CombinedLogger as t, type Literal as u, type RenderableStream as v, type RenderResult as w, attachedContextSymbol as x, type AIElement as y, type Renderable as z };
|
|
@@ -66,6 +66,7 @@ type Chain<V extends Record<string, any> = Record<string, any>, R = any> = {
|
|
|
66
66
|
};
|
|
67
67
|
|
|
68
68
|
declare const LoggerContext: Context<LogImplementation>;
|
|
69
|
+
type ContextValues = Record<symbol, any>;
|
|
69
70
|
type RenderOptions = {
|
|
70
71
|
preserveTags?: boolean;
|
|
71
72
|
renderedProps?: {
|
|
@@ -201,4 +202,4 @@ declare function AIFragment({ children }: {
|
|
|
201
202
|
children: AINode;
|
|
202
203
|
}): Renderable;
|
|
203
204
|
|
|
204
|
-
export { type AINode as A, BoundLogger as B, type
|
|
205
|
+
export { type AINode as A, BoundLogger as B, type ContextValues as C, type PropsOfAIComponent as D, type EvaluatorFn as E, type EvaluatorResult as F, type PromptRenderResult as G, LogImplementation as L, NoopLogImplementation as N, type OutputParser as O, type PromptParsed as P, type RenderContext as R, SystemMessage as S, UserMessage as U, type Context as a, type AIComponent as b, type Prompt as c, type Chain as d, createAIElement as e, AIFragment as f, LoggerContext as g, createContext as h, type ChatCompletionRole as i, AssistantMessage as j, type RenderedConversationMessage as k, computeUsage as l, ChatCompletionError as m, type ChatCompletionRequestPayloads as n, type LogChatCompletionRequest as o, type LogChatCompletionResponse as p, type LogLevel as q, type Logger as r, ConsoleLogger as s, CombinedLogger as t, type Literal as u, type RenderableStream as v, type RenderResult as w, attachedContextSymbol as x, type AIElement as y, type Renderable as z };
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderContext, L as LogImplementation, C as Context, A as AINode,
|
|
2
|
-
export {
|
|
1
|
+
import { R as RenderContext, L as LogImplementation, C as ContextValues, a as Context, A as AINode, b as AIComponent, E as EvaluatorFn, P as PromptParsed, c as Prompt, d as Chain } from './createElement-_dIoXoIE.mjs';
|
|
2
|
+
export { y as AIElement, f as AIFragment, j as AssistantMessage, B as BoundLogger, m as ChatCompletionError, n as ChatCompletionRequestPayloads, i as ChatCompletionRole, t as CombinedLogger, s as ConsoleLogger, F as EvaluatorResult, u as Literal, o as LogChatCompletionRequest, p as LogChatCompletionResponse, q as LogLevel, r as Logger, g as LoggerContext, N as NoopLogImplementation, O as OutputParser, G as PromptRenderResult, D as PropsOfAIComponent, w as RenderResult, z as Renderable, v as RenderableStream, k as RenderedConversationMessage, S as SystemMessage, U as UserMessage, x as attachedContextSymbol, l as computeUsage, e as createAIElement, h as createContext } from './createElement-_dIoXoIE.mjs';
|
|
3
3
|
import { OpenAI } from 'openai';
|
|
4
4
|
export { OpenAI as OpenAIClient } from 'openai';
|
|
5
5
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ChatCompletionAssistantMessageParam, ChatCompletionCreateParams } from 'openai/resources';
|
|
@@ -11,8 +11,9 @@ import { ZodObject, ZodRawShape, ZodTypeAny, ZodString, z } from 'zod';
|
|
|
11
11
|
type CreateRenderContextOptions = {
|
|
12
12
|
logger?: LogImplementation;
|
|
13
13
|
rootRenderId?: string;
|
|
14
|
+
contextValues?: ContextValues;
|
|
14
15
|
};
|
|
15
|
-
declare function createRenderContext({ logger, rootRenderId, }?: CreateRenderContextOptions): RenderContext;
|
|
16
|
+
declare function createRenderContext({ logger, rootRenderId, contextValues, }?: CreateRenderContextOptions): RenderContext;
|
|
16
17
|
|
|
17
18
|
type OpenAIChatCompletionRequest = OpenAI.Chat.Completions.ChatCompletionCreateParamsStreaming;
|
|
18
19
|
type OpenAIChatMessage = ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { R as RenderContext, L as LogImplementation, C as Context, A as AINode,
|
|
2
|
-
export {
|
|
1
|
+
import { R as RenderContext, L as LogImplementation, C as ContextValues, a as Context, A as AINode, b as AIComponent, E as EvaluatorFn, P as PromptParsed, c as Prompt, d as Chain } from './createElement-_dIoXoIE.js';
|
|
2
|
+
export { y as AIElement, f as AIFragment, j as AssistantMessage, B as BoundLogger, m as ChatCompletionError, n as ChatCompletionRequestPayloads, i as ChatCompletionRole, t as CombinedLogger, s as ConsoleLogger, F as EvaluatorResult, u as Literal, o as LogChatCompletionRequest, p as LogChatCompletionResponse, q as LogLevel, r as Logger, g as LoggerContext, N as NoopLogImplementation, O as OutputParser, G as PromptRenderResult, D as PropsOfAIComponent, w as RenderResult, z as Renderable, v as RenderableStream, k as RenderedConversationMessage, S as SystemMessage, U as UserMessage, x as attachedContextSymbol, l as computeUsage, e as createAIElement, h as createContext } from './createElement-_dIoXoIE.js';
|
|
3
3
|
import { OpenAI } from 'openai';
|
|
4
4
|
export { OpenAI as OpenAIClient } from 'openai';
|
|
5
5
|
import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ChatCompletionAssistantMessageParam, ChatCompletionCreateParams } from 'openai/resources';
|
|
@@ -11,8 +11,9 @@ import { ZodObject, ZodRawShape, ZodTypeAny, ZodString, z } from 'zod';
|
|
|
11
11
|
type CreateRenderContextOptions = {
|
|
12
12
|
logger?: LogImplementation;
|
|
13
13
|
rootRenderId?: string;
|
|
14
|
+
contextValues?: ContextValues;
|
|
14
15
|
};
|
|
15
|
-
declare function createRenderContext({ logger, rootRenderId, }?: CreateRenderContextOptions): RenderContext;
|
|
16
|
+
declare function createRenderContext({ logger, rootRenderId, contextValues, }?: CreateRenderContextOptions): RenderContext;
|
|
16
17
|
|
|
17
18
|
type OpenAIChatCompletionRequest = OpenAI.Chat.Completions.ChatCompletionCreateParamsStreaming;
|
|
18
19
|
type OpenAIChatMessage = ChatCompletionSystemMessageParam | ChatCompletionUserMessageParam | ChatCompletionAssistantMessageParam;
|
package/dist/index.js
CHANGED
|
@@ -428,14 +428,16 @@ function Root() {
|
|
|
428
428
|
}
|
|
429
429
|
function createRenderContext({
|
|
430
430
|
logger = new NoopLogImplementation(),
|
|
431
|
-
rootRenderId = uuidv4()
|
|
431
|
+
rootRenderId = uuidv4(),
|
|
432
|
+
contextValues = {}
|
|
432
433
|
} = {}) {
|
|
433
434
|
return new StreamRenderContext(
|
|
434
435
|
null,
|
|
435
436
|
createAIElement(Root, {}),
|
|
436
437
|
rootRenderId,
|
|
437
438
|
{
|
|
438
|
-
[LoggerContext.key]: logger || LoggerContext.defaultValue
|
|
439
|
+
[LoggerContext.key]: logger || LoggerContext.defaultValue,
|
|
440
|
+
...contextValues
|
|
439
441
|
}
|
|
440
442
|
);
|
|
441
443
|
}
|
package/dist/index.mjs
CHANGED
|
@@ -341,14 +341,16 @@ function Root() {
|
|
|
341
341
|
}
|
|
342
342
|
function createRenderContext({
|
|
343
343
|
logger = new NoopLogImplementation(),
|
|
344
|
-
rootRenderId = uuidv4()
|
|
344
|
+
rootRenderId = uuidv4(),
|
|
345
|
+
contextValues = {}
|
|
345
346
|
} = {}) {
|
|
346
347
|
return new StreamRenderContext(
|
|
347
348
|
null,
|
|
348
349
|
createAIElement(Root, {}),
|
|
349
350
|
rootRenderId,
|
|
350
351
|
{
|
|
351
|
-
[LoggerContext.key]: logger || LoggerContext.defaultValue
|
|
352
|
+
[LoggerContext.key]: logger || LoggerContext.defaultValue,
|
|
353
|
+
...contextValues
|
|
352
354
|
}
|
|
353
355
|
);
|
|
354
356
|
}
|
package/dist/jsx-runtime.d.mts
CHANGED
package/dist/jsx-runtime.d.ts
CHANGED