@gammatech/aijsx 0.5.0-dev.2024-03-12 → 0.5.0-dev.2024-03-13
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 +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.mjs +3 -3
- package/dist/{jsx-dev-runtime-LS-DZfkv.d.mts → jsx-dev-runtime-j4JCaPsB.d.mts} +1 -1
- package/dist/{jsx-dev-runtime-LS-DZfkv.d.ts → jsx-dev-runtime-j4JCaPsB.d.ts} +1 -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 { 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, i as ChatCompletionClientAndProvider, J as JSX } from './jsx-dev-runtime-
|
|
2
|
-
export { I as AIElement, k as AIFragment, o as AssistantMessage, B as BoundLogger, r as ChatCompletionError, s as ChatCompletionRequestPayloads, m as ChatCompletionRole, z as CombinedLogger, y as ConsoleLogger, D as Literal, t as LogChatCompletionRequest, u as LogChatCompletionResponse, v as LogLevel, w as Logger, x as NoopLogImplementation, _ as OutputParser, M as PropsOfAIComponent, G as RenderResult, K as Renderable, p as RenderedConversationMessage, V as Span, O as SpanContext, W as SpanEvent, Q as SpanStatus, n as SystemMessage, Y as TracingContext, X as TracingContextKey, Z as TracingContextManager, U as UserMessage, H as attachedContextSymbol, q as computeUsage, j as createAIElement, l as createContext } from './jsx-dev-runtime-
|
|
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, i as ChatCompletionClientAndProvider, J as JSX } from './jsx-dev-runtime-j4JCaPsB.mjs';
|
|
2
|
+
export { I as AIElement, k as AIFragment, o as AssistantMessage, B as BoundLogger, r as ChatCompletionError, s as ChatCompletionRequestPayloads, m as ChatCompletionRole, z as CombinedLogger, y as ConsoleLogger, D as Literal, t as LogChatCompletionRequest, u as LogChatCompletionResponse, v as LogLevel, w as Logger, x as NoopLogImplementation, _ as OutputParser, M as PropsOfAIComponent, G as RenderResult, K as Renderable, p as RenderedConversationMessage, V as Span, O as SpanContext, W as SpanEvent, Q as SpanStatus, n as SystemMessage, Y as TracingContext, X as TracingContextKey, Z as TracingContextManager, U as UserMessage, H as attachedContextSymbol, q as computeUsage, j as createAIElement, l as createContext } from './jsx-dev-runtime-j4JCaPsB.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';
|
|
@@ -181,7 +181,7 @@ declare module '@gammatech/aijsx' {
|
|
|
181
181
|
* The set of valid Claude models.
|
|
182
182
|
* @see https://docs.anthropic.com/claude/reference/selecting-a-model
|
|
183
183
|
*/
|
|
184
|
-
type ValidAnthropicChatModel = 'claude-instant-1.2' | 'claude-2.1' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229';
|
|
184
|
+
type ValidAnthropicChatModel = 'claude-instant-1.2' | 'claude-2.1' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307';
|
|
185
185
|
declare const AnthropicClientContext: Context<() => ChatCompletionClientAndProvider<AnthropicClient>>;
|
|
186
186
|
type AnthropicChatCompletionProps = {
|
|
187
187
|
model: ValidAnthropicChatModel;
|
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, 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, i as ChatCompletionClientAndProvider, J as JSX } from './jsx-dev-runtime-
|
|
2
|
-
export { I as AIElement, k as AIFragment, o as AssistantMessage, B as BoundLogger, r as ChatCompletionError, s as ChatCompletionRequestPayloads, m as ChatCompletionRole, z as CombinedLogger, y as ConsoleLogger, D as Literal, t as LogChatCompletionRequest, u as LogChatCompletionResponse, v as LogLevel, w as Logger, x as NoopLogImplementation, _ as OutputParser, M as PropsOfAIComponent, G as RenderResult, K as Renderable, p as RenderedConversationMessage, V as Span, O as SpanContext, W as SpanEvent, Q as SpanStatus, n as SystemMessage, Y as TracingContext, X as TracingContextKey, Z as TracingContextManager, U as UserMessage, H as attachedContextSymbol, q as computeUsage, j as createAIElement, l as createContext } from './jsx-dev-runtime-
|
|
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, i as ChatCompletionClientAndProvider, J as JSX } from './jsx-dev-runtime-j4JCaPsB.js';
|
|
2
|
+
export { I as AIElement, k as AIFragment, o as AssistantMessage, B as BoundLogger, r as ChatCompletionError, s as ChatCompletionRequestPayloads, m as ChatCompletionRole, z as CombinedLogger, y as ConsoleLogger, D as Literal, t as LogChatCompletionRequest, u as LogChatCompletionResponse, v as LogLevel, w as Logger, x as NoopLogImplementation, _ as OutputParser, M as PropsOfAIComponent, G as RenderResult, K as Renderable, p as RenderedConversationMessage, V as Span, O as SpanContext, W as SpanEvent, Q as SpanStatus, n as SystemMessage, Y as TracingContext, X as TracingContextKey, Z as TracingContextManager, U as UserMessage, H as attachedContextSymbol, q as computeUsage, j as createAIElement, l as createContext } from './jsx-dev-runtime-j4JCaPsB.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';
|
|
@@ -181,7 +181,7 @@ declare module '@gammatech/aijsx' {
|
|
|
181
181
|
* The set of valid Claude models.
|
|
182
182
|
* @see https://docs.anthropic.com/claude/reference/selecting-a-model
|
|
183
183
|
*/
|
|
184
|
-
type ValidAnthropicChatModel = 'claude-instant-1.2' | 'claude-2.1' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229';
|
|
184
|
+
type ValidAnthropicChatModel = 'claude-instant-1.2' | 'claude-2.1' | 'claude-3-opus-20240229' | 'claude-3-sonnet-20240229' | 'claude-3-haiku-20240307';
|
|
185
185
|
declare const AnthropicClientContext: Context<() => ChatCompletionClientAndProvider<AnthropicClient>>;
|
|
186
186
|
type AnthropicChatCompletionProps = {
|
|
187
187
|
model: ValidAnthropicChatModel;
|
package/dist/index.js
CHANGED
|
@@ -1870,7 +1870,7 @@ function OpenAIChatCompletion(props, { logger, render, tracer, getContext }) {
|
|
|
1870
1870
|
})
|
|
1871
1871
|
};
|
|
1872
1872
|
const tokensUsed = computeUsage([...renderedMessages, outputMessage]);
|
|
1873
|
-
const cost = costFn?.(tokensUsed) ?? void 0;
|
|
1873
|
+
const cost = costFn?.(props.model, tokensUsed) ?? void 0;
|
|
1874
1874
|
const responseData = {
|
|
1875
1875
|
...logRequestData,
|
|
1876
1876
|
finishReason,
|
|
@@ -2083,7 +2083,7 @@ function OpenAIVisionChatCompletion(props, { logger, render, tracer, getContext
|
|
|
2083
2083
|
})
|
|
2084
2084
|
};
|
|
2085
2085
|
const tokensUsed = computeUsage([...renderedMessages, outputMessage]);
|
|
2086
|
-
const cost = costFn?.(tokensUsed) ?? void 0;
|
|
2086
|
+
const cost = costFn?.(model, tokensUsed) ?? void 0;
|
|
2087
2087
|
const responseData = {
|
|
2088
2088
|
...logRequestData,
|
|
2089
2089
|
finishReason,
|
|
@@ -2284,7 +2284,7 @@ function AnthropicChatCompletion(props, { render, logger, tracer, getContext })
|
|
|
2284
2284
|
userMessage.tokens = inputUsage - restMessagesTokens;
|
|
2285
2285
|
}
|
|
2286
2286
|
const tokensUsed = computeUsage([...inputMessages, outputMessage]);
|
|
2287
|
-
const cost = costFn?.(tokensUsed) ?? void 0;
|
|
2287
|
+
const cost = costFn?.(props.model, tokensUsed) ?? void 0;
|
|
2288
2288
|
const responseData = {
|
|
2289
2289
|
...logRequestData,
|
|
2290
2290
|
finishReason,
|
package/dist/index.mjs
CHANGED
|
@@ -1772,7 +1772,7 @@ function OpenAIChatCompletion(props, { logger, render, tracer, getContext }) {
|
|
|
1772
1772
|
})
|
|
1773
1773
|
};
|
|
1774
1774
|
const tokensUsed = computeUsage([...renderedMessages, outputMessage]);
|
|
1775
|
-
const cost = costFn?.(tokensUsed) ?? void 0;
|
|
1775
|
+
const cost = costFn?.(props.model, tokensUsed) ?? void 0;
|
|
1776
1776
|
const responseData = {
|
|
1777
1777
|
...logRequestData,
|
|
1778
1778
|
finishReason,
|
|
@@ -1985,7 +1985,7 @@ function OpenAIVisionChatCompletion(props, { logger, render, tracer, getContext
|
|
|
1985
1985
|
})
|
|
1986
1986
|
};
|
|
1987
1987
|
const tokensUsed = computeUsage([...renderedMessages, outputMessage]);
|
|
1988
|
-
const cost = costFn?.(tokensUsed) ?? void 0;
|
|
1988
|
+
const cost = costFn?.(model, tokensUsed) ?? void 0;
|
|
1989
1989
|
const responseData = {
|
|
1990
1990
|
...logRequestData,
|
|
1991
1991
|
finishReason,
|
|
@@ -2186,7 +2186,7 @@ function AnthropicChatCompletion(props, { render, logger, tracer, getContext })
|
|
|
2186
2186
|
userMessage.tokens = inputUsage - restMessagesTokens;
|
|
2187
2187
|
}
|
|
2188
2188
|
const tokensUsed = computeUsage([...inputMessages, outputMessage]);
|
|
2189
|
-
const cost = costFn?.(tokensUsed) ?? void 0;
|
|
2189
|
+
const cost = costFn?.(props.model, tokensUsed) ?? void 0;
|
|
2190
2190
|
const responseData = {
|
|
2191
2191
|
...logRequestData,
|
|
2192
2192
|
finishReason,
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-j4JCaPsB.mjs';
|
|
2
2
|
import 'zod';
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-j4JCaPsB.js';
|
|
2
2
|
import 'zod';
|
package/dist/jsx-runtime.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-j4JCaPsB.mjs';
|
|
2
2
|
import 'zod';
|
package/dist/jsx-runtime.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-
|
|
1
|
+
export { a2 as Fragment, J as JSX, $ as jsx, a0 as jsxDEV, a1 as jsxs } from './jsx-dev-runtime-j4JCaPsB.js';
|
|
2
2
|
import 'zod';
|