@gammatech/aijsx 0.8.1-dev.2024-05-24.2 → 0.9.1-dev.2024-05-28

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 CHANGED
@@ -1,13 +1,48 @@
1
- import { R as RenderContext, L as LogImplementation, S as SpanProcessor, C as ContextValues, a as Context, A as AINode, T as Tracer, b as ReadableSpan, c as SpanExporter, d as AIComponent, e as SpanAttributes, P as Prompt, f as ChatCompletionRequestPayloads, g as RenderedConversationMessage, E as EvaluatorResult, h as EvaluatorFn, i as PromptParsed, N as NotAsyncGenerator, F as FunctionChain, j as StreamChain, k as ChatCompletionClientAndProvider, J as JSX } from './jsx-dev-runtime-Kh2H5_Cf.mjs';
2
- export { I as AIElement, m as AIFragment, q as AssistantMessage, B as BoundLogger, s as ChatCompletionError, o 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, V as Span, O as SpanContext, W as SpanEvent, Q as SpanStatus, p as SystemMessage, Y as TracingContext, X as TracingContextKey, Z as TracingContextManager, U as UserMessage, H as attachedContextSymbol, r as computeUsage, l as createAIElement, n as createContext } from './jsx-dev-runtime-Kh2H5_Cf.mjs';
1
+ import { L as LogChatCompletionRequest, A as AINode, C as ChatMessage, R as RenderContext, a as LogImplementation, S as SpanProcessor, b as ContextValues, c as Context, T as Tracer, d as ReadableSpan, e as SpanExporter, f as AIComponent, g as SpanAttributes, P as Prompt, h as ChatCompletionRequestPayloads, D as DebugMessage, E as EvaluatorResult, i as EvaluatorFn, j as PromptParsed, N as NotAsyncGenerator, F as FunctionChain, k as StreamChain, J as JSX } from './jsx-dev-runtime-uCZBuaDe.mjs';
2
+ export { G as AIElement, m as AIFragment, B as BoundLogger, o as ChatRole, w as CombinedLogger, v as ConsoleLogger, I as ImagePart, p as ImagePartProps, x as Literal, q as LogChatCompletionResponse, r as LogLevel, s as Logger, u as NoopLogImplementation, Y as OutputParser, K as PropsOfAIComponent, y as RenderResult, H as Renderable, Q as Span, M as SpanContext, U as SpanEvent, O as SpanStatus, W as TracingContext, V as TracingContextKey, X as TracingContextManager, z as attachedContextSymbol, l as createAIElement, n as createContext, t as toDebugMessage } from './jsx-dev-runtime-uCZBuaDe.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';
6
6
  import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ChatCompletionAssistantMessageParam, ChatCompletionCreateParams } from 'openai/resources';
7
7
  import AnthropicClient from '@anthropic-ai/sdk';
8
8
  export { default as AnthropicClient } from '@anthropic-ai/sdk';
9
- import { ImageBlockParam } from '@anthropic-ai/sdk/resources';
10
- export { countTokens as countAnthropicTokens } from '@anthropic-ai/tokenizer';
9
+ import { GenerateContentRequest, VertexAI } from '@google-cloud/vertexai';
10
+ export { VertexAI } from '@google-cloud/vertexai';
11
+
12
+ declare class ChatCompletionError extends Error {
13
+ readonly chatCompletionRequest: LogChatCompletionRequest;
14
+ readonly status: number | undefined;
15
+ readonly shouldRetry: boolean;
16
+ readonly name = "ChatCompletionError";
17
+ constructor(message: string, chatCompletionRequest: LogChatCompletionRequest, status: number | undefined, shouldRetry?: boolean);
18
+ }
19
+
20
+ declare const SystemMessage: (props: {
21
+ children: AINode;
22
+ }) => AINode;
23
+ declare const UserMessage: (props: {
24
+ children: AINode;
25
+ }) => AINode;
26
+ declare const AssistantMessage: (props: {
27
+ children: AINode;
28
+ }) => AINode;
29
+
30
+ type TokenizerFn = (message: ChatMessage) => number;
31
+ declare const computeUsage: (messages: ChatMessage[], tokenizer: TokenizerFn) => {
32
+ prompt: number;
33
+ completion: number;
34
+ total: number;
35
+ };
36
+
37
+ type ChatCompletionClientAndProvider<K> = {
38
+ client: K;
39
+ provider?: string;
40
+ providerRegion?: string;
41
+ costFn?: (model: string, usage: {
42
+ prompt: number;
43
+ completion: number;
44
+ }) => number;
45
+ };
11
46
 
12
47
  type CreateRenderContextOptions = {
13
48
  logger?: LogImplementation;
@@ -129,7 +164,7 @@ declare namespace AISpanAttributes {
129
164
  retryCount?: number;
130
165
  requestType: K;
131
166
  chatCompletionRequest: ChatCompletionRequestPayloads[K];
132
- inputMessages: RenderedConversationMessage[];
167
+ inputMessages: DebugMessage[];
133
168
  finishReason: string | null;
134
169
  output: string;
135
170
  tokensUsed: Usage;
@@ -200,7 +235,8 @@ declare module '@gammatech/aijsx' {
200
235
  openai: OpenAIChatCompletionRequest;
201
236
  }
202
237
  }
203
- type ValidOpenAIChatModel = 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-4-1106-preview' | 'gpt-4-0125-preview' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-16k-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125';
238
+ type ValidOpenAIVisionModel = 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4-vision-preview';
239
+ type ValidOpenAIChatModel = ValidOpenAIVisionModel | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-4-1106-preview' | 'gpt-4-0125-preview' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-16k-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125';
204
240
  declare const OpenAIClientContext: Context<() => ChatCompletionClientAndProvider<OpenAI>>;
205
241
  type OpenAIChatCompletionProps = {
206
242
  model: ValidOpenAIChatModel;
@@ -213,33 +249,7 @@ type OpenAIChatCompletionProps = {
213
249
  };
214
250
  declare function OpenAIChatCompletion(props: OpenAIChatCompletionProps, ctx: RenderContext): AINode;
215
251
 
216
- type ValidOpenAIVisionModel = 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4-vision-preview';
217
- declare const ContentTypeImage: (_props: {
218
- url: string;
219
- dimensions?: {
220
- width: number;
221
- height: number;
222
- };
223
- detail?: 'auto' | 'high' | 'low';
224
- }) => null;
225
- type OpenAIVisionChatCompletionProps = {
226
- model?: ValidOpenAIVisionModel;
227
- maxTokens?: number;
228
- stop?: string | string[];
229
- temperature?: number;
230
- maxRetries?: number;
231
- children: AINode;
232
- };
233
- declare function OpenAIVisionChatCompletion(props: OpenAIVisionChatCompletionProps, ctx: RenderContext): AINode;
234
- declare function OpenAIVisionChatCompletionInner(props: OpenAIVisionChatCompletionProps, { logger, render, tracer, getContext }: RenderContext): AsyncGenerator<string, void, unknown>;
235
-
236
- declare const tokenizer: {
237
- encode: (text: string) => number[];
238
- decode: (tokens: number[]) => string;
239
- };
240
- declare function tokenLimitForChatModel(model: ValidOpenAIChatModel): number | undefined;
241
- declare function tokenCountForOpenAIMessage(message: OpenAIChatMessage): number;
242
- declare function tokenCountForOpenAIVisionMessage(message: OpenAIChatMessage): number;
252
+ declare const openaiTokenizer: TokenizerFn;
243
253
 
244
254
  type AnthropicChatCompletionRequest = AnthropicClient.Messages.MessageStreamParams;
245
255
  declare module '@gammatech/aijsx' {
@@ -262,23 +272,25 @@ type AnthropicChatCompletionProps = {
262
272
  children: AINode;
263
273
  };
264
274
  declare function AnthropicChatCompletion(props: AnthropicChatCompletionProps, ctx: RenderContext): JSX.Element;
265
- /**
266
- * An AI.JSX component that invokes an Anthropic Large Language Model.
267
- * @param children The children to render.
268
- * @param chatModel The chat model to use.
269
- * @param completionModel The completion model to use.
270
- * @param client The Anthropic client.
271
- */
272
- declare function AnthropicChatCompletionInner(props: AnthropicChatCompletionProps, { render, logger, tracer, getContext }: RenderContext): AsyncGenerator<string, void, unknown>;
273
275
 
274
- type ClaudeImageBlockBase64 = {
275
- data: string;
276
- mediaType: ImageBlockParam.Source['media_type'];
277
- };
278
- type ClaudeImageBlockUrl = {
279
- url: string;
276
+ declare const anthropicTokenizer: TokenizerFn;
277
+
278
+ type GoogleChatCompletionRequest = GenerateContentRequest;
279
+ declare module '@gammatech/aijsx' {
280
+ interface ChatCompletionRequestPayloads {
281
+ google: GoogleChatCompletionRequest;
282
+ }
283
+ }
284
+ type ValidGoogleChatModel = 'gemini-1.5-pro' | 'gemini-1.5-flash';
285
+ declare const GoogleClientContext: Context<() => ChatCompletionClientAndProvider<VertexAI>>;
286
+ type GoogleChatCompletionProps = {
287
+ model: ValidGoogleChatModel;
288
+ maxTokens?: number;
289
+ temperature?: number;
290
+ stop?: string | string[];
291
+ maxRetries?: number;
292
+ children: AINode;
280
293
  };
281
- type ClaudeImageBlockProps = ClaudeImageBlockBase64 | ClaudeImageBlockUrl;
282
- declare const ClaudeImageBlock: (props: ClaudeImageBlockProps) => Promise<JSX.Element>;
294
+ declare function GoogleChatCompletion(props: GoogleChatCompletionProps, ctx: RenderContext): JSX.Element;
283
295
 
284
- export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, AnthropicChatCompletion, AnthropicChatCompletionInner, type AnthropicChatCompletionRequest, AnthropicClientContext, ChatCompletionClientAndProvider, type ChatCompletionRequestPayloads, ClaudeImageBlock, ContentTypeImage, Context, type CostFn, DefaultMaxRetriesContext, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, Fallback, FunctionChain, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, OpenAIVisionChatCompletion, OpenAIVisionChatCompletionInner, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, RenderedConversationMessage, Retry, RetryCountContext, SpanAttributes, SpanExporter, SpanProcessor, StreamChain, Trace, Tracer, type ValidAnthropicChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, tokenCountForOpenAIMessage, tokenCountForOpenAIVisionMessage, tokenLimitForChatModel, tokenizer, tracing };
296
+ export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, AssistantMessage, type ChatCompletionClientAndProvider, ChatCompletionError, type ChatCompletionRequestPayloads, ChatMessage, Context, type CostFn, DebugMessage, DefaultMaxRetriesContext, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, Fallback, FunctionChain, GoogleChatCompletion, type GoogleChatCompletionRequest, GoogleClientContext, LogChatCompletionRequest, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, Retry, RetryCountContext, SpanAttributes, SpanExporter, SpanProcessor, StreamChain, SystemMessage, type TokenizerFn, Trace, Tracer, UserMessage, type ValidAnthropicChatModel, type ValidGoogleChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, anthropicTokenizer, computeUsage, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, openaiTokenizer, tracing };
package/dist/index.d.ts CHANGED
@@ -1,13 +1,48 @@
1
- import { R as RenderContext, L as LogImplementation, S as SpanProcessor, C as ContextValues, a as Context, A as AINode, T as Tracer, b as ReadableSpan, c as SpanExporter, d as AIComponent, e as SpanAttributes, P as Prompt, f as ChatCompletionRequestPayloads, g as RenderedConversationMessage, E as EvaluatorResult, h as EvaluatorFn, i as PromptParsed, N as NotAsyncGenerator, F as FunctionChain, j as StreamChain, k as ChatCompletionClientAndProvider, J as JSX } from './jsx-dev-runtime-Kh2H5_Cf.js';
2
- export { I as AIElement, m as AIFragment, q as AssistantMessage, B as BoundLogger, s as ChatCompletionError, o 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, V as Span, O as SpanContext, W as SpanEvent, Q as SpanStatus, p as SystemMessage, Y as TracingContext, X as TracingContextKey, Z as TracingContextManager, U as UserMessage, H as attachedContextSymbol, r as computeUsage, l as createAIElement, n as createContext } from './jsx-dev-runtime-Kh2H5_Cf.js';
1
+ import { L as LogChatCompletionRequest, A as AINode, C as ChatMessage, R as RenderContext, a as LogImplementation, S as SpanProcessor, b as ContextValues, c as Context, T as Tracer, d as ReadableSpan, e as SpanExporter, f as AIComponent, g as SpanAttributes, P as Prompt, h as ChatCompletionRequestPayloads, D as DebugMessage, E as EvaluatorResult, i as EvaluatorFn, j as PromptParsed, N as NotAsyncGenerator, F as FunctionChain, k as StreamChain, J as JSX } from './jsx-dev-runtime-uCZBuaDe.js';
2
+ export { G as AIElement, m as AIFragment, B as BoundLogger, o as ChatRole, w as CombinedLogger, v as ConsoleLogger, I as ImagePart, p as ImagePartProps, x as Literal, q as LogChatCompletionResponse, r as LogLevel, s as Logger, u as NoopLogImplementation, Y as OutputParser, K as PropsOfAIComponent, y as RenderResult, H as Renderable, Q as Span, M as SpanContext, U as SpanEvent, O as SpanStatus, W as TracingContext, V as TracingContextKey, X as TracingContextManager, z as attachedContextSymbol, l as createAIElement, n as createContext, t as toDebugMessage } from './jsx-dev-runtime-uCZBuaDe.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';
6
6
  import { ChatCompletionSystemMessageParam, ChatCompletionUserMessageParam, ChatCompletionAssistantMessageParam, ChatCompletionCreateParams } from 'openai/resources';
7
7
  import AnthropicClient from '@anthropic-ai/sdk';
8
8
  export { default as AnthropicClient } from '@anthropic-ai/sdk';
9
- import { ImageBlockParam } from '@anthropic-ai/sdk/resources';
10
- export { countTokens as countAnthropicTokens } from '@anthropic-ai/tokenizer';
9
+ import { GenerateContentRequest, VertexAI } from '@google-cloud/vertexai';
10
+ export { VertexAI } from '@google-cloud/vertexai';
11
+
12
+ declare class ChatCompletionError extends Error {
13
+ readonly chatCompletionRequest: LogChatCompletionRequest;
14
+ readonly status: number | undefined;
15
+ readonly shouldRetry: boolean;
16
+ readonly name = "ChatCompletionError";
17
+ constructor(message: string, chatCompletionRequest: LogChatCompletionRequest, status: number | undefined, shouldRetry?: boolean);
18
+ }
19
+
20
+ declare const SystemMessage: (props: {
21
+ children: AINode;
22
+ }) => AINode;
23
+ declare const UserMessage: (props: {
24
+ children: AINode;
25
+ }) => AINode;
26
+ declare const AssistantMessage: (props: {
27
+ children: AINode;
28
+ }) => AINode;
29
+
30
+ type TokenizerFn = (message: ChatMessage) => number;
31
+ declare const computeUsage: (messages: ChatMessage[], tokenizer: TokenizerFn) => {
32
+ prompt: number;
33
+ completion: number;
34
+ total: number;
35
+ };
36
+
37
+ type ChatCompletionClientAndProvider<K> = {
38
+ client: K;
39
+ provider?: string;
40
+ providerRegion?: string;
41
+ costFn?: (model: string, usage: {
42
+ prompt: number;
43
+ completion: number;
44
+ }) => number;
45
+ };
11
46
 
12
47
  type CreateRenderContextOptions = {
13
48
  logger?: LogImplementation;
@@ -129,7 +164,7 @@ declare namespace AISpanAttributes {
129
164
  retryCount?: number;
130
165
  requestType: K;
131
166
  chatCompletionRequest: ChatCompletionRequestPayloads[K];
132
- inputMessages: RenderedConversationMessage[];
167
+ inputMessages: DebugMessage[];
133
168
  finishReason: string | null;
134
169
  output: string;
135
170
  tokensUsed: Usage;
@@ -200,7 +235,8 @@ declare module '@gammatech/aijsx' {
200
235
  openai: OpenAIChatCompletionRequest;
201
236
  }
202
237
  }
203
- type ValidOpenAIChatModel = 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-4-1106-preview' | 'gpt-4-0125-preview' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-16k-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125';
238
+ type ValidOpenAIVisionModel = 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4-vision-preview';
239
+ type ValidOpenAIChatModel = ValidOpenAIVisionModel | 'gpt-4' | 'gpt-4-0314' | 'gpt-4-0613' | 'gpt-4-32k' | 'gpt-4-32k-0314' | 'gpt-4-32k-0613' | 'gpt-4-1106-preview' | 'gpt-4-0125-preview' | 'gpt-3.5-turbo' | 'gpt-3.5-turbo-0301' | 'gpt-3.5-turbo-0613' | 'gpt-3.5-turbo-16k' | 'gpt-3.5-turbo-16k-0613' | 'gpt-3.5-turbo-1106' | 'gpt-3.5-turbo-0125';
204
240
  declare const OpenAIClientContext: Context<() => ChatCompletionClientAndProvider<OpenAI>>;
205
241
  type OpenAIChatCompletionProps = {
206
242
  model: ValidOpenAIChatModel;
@@ -213,33 +249,7 @@ type OpenAIChatCompletionProps = {
213
249
  };
214
250
  declare function OpenAIChatCompletion(props: OpenAIChatCompletionProps, ctx: RenderContext): AINode;
215
251
 
216
- type ValidOpenAIVisionModel = 'gpt-4o' | 'gpt-4o-2024-05-13' | 'gpt-4-turbo-2024-04-09' | 'gpt-4-turbo' | 'gpt-4-vision-preview';
217
- declare const ContentTypeImage: (_props: {
218
- url: string;
219
- dimensions?: {
220
- width: number;
221
- height: number;
222
- };
223
- detail?: 'auto' | 'high' | 'low';
224
- }) => null;
225
- type OpenAIVisionChatCompletionProps = {
226
- model?: ValidOpenAIVisionModel;
227
- maxTokens?: number;
228
- stop?: string | string[];
229
- temperature?: number;
230
- maxRetries?: number;
231
- children: AINode;
232
- };
233
- declare function OpenAIVisionChatCompletion(props: OpenAIVisionChatCompletionProps, ctx: RenderContext): AINode;
234
- declare function OpenAIVisionChatCompletionInner(props: OpenAIVisionChatCompletionProps, { logger, render, tracer, getContext }: RenderContext): AsyncGenerator<string, void, unknown>;
235
-
236
- declare const tokenizer: {
237
- encode: (text: string) => number[];
238
- decode: (tokens: number[]) => string;
239
- };
240
- declare function tokenLimitForChatModel(model: ValidOpenAIChatModel): number | undefined;
241
- declare function tokenCountForOpenAIMessage(message: OpenAIChatMessage): number;
242
- declare function tokenCountForOpenAIVisionMessage(message: OpenAIChatMessage): number;
252
+ declare const openaiTokenizer: TokenizerFn;
243
253
 
244
254
  type AnthropicChatCompletionRequest = AnthropicClient.Messages.MessageStreamParams;
245
255
  declare module '@gammatech/aijsx' {
@@ -262,23 +272,25 @@ type AnthropicChatCompletionProps = {
262
272
  children: AINode;
263
273
  };
264
274
  declare function AnthropicChatCompletion(props: AnthropicChatCompletionProps, ctx: RenderContext): JSX.Element;
265
- /**
266
- * An AI.JSX component that invokes an Anthropic Large Language Model.
267
- * @param children The children to render.
268
- * @param chatModel The chat model to use.
269
- * @param completionModel The completion model to use.
270
- * @param client The Anthropic client.
271
- */
272
- declare function AnthropicChatCompletionInner(props: AnthropicChatCompletionProps, { render, logger, tracer, getContext }: RenderContext): AsyncGenerator<string, void, unknown>;
273
275
 
274
- type ClaudeImageBlockBase64 = {
275
- data: string;
276
- mediaType: ImageBlockParam.Source['media_type'];
277
- };
278
- type ClaudeImageBlockUrl = {
279
- url: string;
276
+ declare const anthropicTokenizer: TokenizerFn;
277
+
278
+ type GoogleChatCompletionRequest = GenerateContentRequest;
279
+ declare module '@gammatech/aijsx' {
280
+ interface ChatCompletionRequestPayloads {
281
+ google: GoogleChatCompletionRequest;
282
+ }
283
+ }
284
+ type ValidGoogleChatModel = 'gemini-1.5-pro' | 'gemini-1.5-flash';
285
+ declare const GoogleClientContext: Context<() => ChatCompletionClientAndProvider<VertexAI>>;
286
+ type GoogleChatCompletionProps = {
287
+ model: ValidGoogleChatModel;
288
+ maxTokens?: number;
289
+ temperature?: number;
290
+ stop?: string | string[];
291
+ maxRetries?: number;
292
+ children: AINode;
280
293
  };
281
- type ClaudeImageBlockProps = ClaudeImageBlockBase64 | ClaudeImageBlockUrl;
282
- declare const ClaudeImageBlock: (props: ClaudeImageBlockProps) => Promise<JSX.Element>;
294
+ declare function GoogleChatCompletion(props: GoogleChatCompletionProps, ctx: RenderContext): JSX.Element;
283
295
 
284
- export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, AnthropicChatCompletion, AnthropicChatCompletionInner, type AnthropicChatCompletionRequest, AnthropicClientContext, ChatCompletionClientAndProvider, type ChatCompletionRequestPayloads, ClaudeImageBlock, ContentTypeImage, Context, type CostFn, DefaultMaxRetriesContext, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, Fallback, FunctionChain, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, OpenAIVisionChatCompletion, OpenAIVisionChatCompletionInner, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, RenderedConversationMessage, Retry, RetryCountContext, SpanAttributes, SpanExporter, SpanProcessor, StreamChain, Trace, Tracer, type ValidAnthropicChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, tokenCountForOpenAIMessage, tokenCountForOpenAIVisionMessage, tokenLimitForChatModel, tokenizer, tracing };
296
+ export { AIComponent, AINode, AISpanAttributes, AISpanProcessor, AnthropicChatCompletion, type AnthropicChatCompletionRequest, AnthropicClientContext, AssistantMessage, type ChatCompletionClientAndProvider, ChatCompletionError, type ChatCompletionRequestPayloads, ChatMessage, Context, type CostFn, DebugMessage, DefaultMaxRetriesContext, EnrichingSpanProcessor, EvaluatorFn, EvaluatorResult, Fallback, FunctionChain, GoogleChatCompletion, type GoogleChatCompletionRequest, GoogleClientContext, LogChatCompletionRequest, LogImplementation, NotAsyncGenerator, OpenAIChatCompletion, type OpenAIChatCompletionRequest, type OpenAIChatMessage, OpenAIClientContext, ParseVariablesError, ProcessedAISpanAttributes, type Prompt, PromptInvalidOutputError, PromptParsed, ReadableSpan, RenderContext, Retry, RetryCountContext, SpanAttributes, SpanExporter, SpanProcessor, StreamChain, SystemMessage, type TokenizerFn, Trace, Tracer, UserMessage, type ValidAnthropicChatModel, type ValidGoogleChatModel, type ValidOpenAIChatModel, type ValidOpenAIVisionModel, anthropicTokenizer, computeUsage, createFunctionChain, createPrompt, createRenderContext, createStreamChain, evaluatePrompt, openaiTokenizer, tracing };