modelfusion 0.134.0 → 0.135.1
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/index.cjs +326 -254
- package/index.cjs.map +1 -1
- package/index.d.cts +39 -11
- package/index.d.ts +39 -11
- package/index.js +332 -254
- package/index.js.map +1 -1
- package/internal/index.cjs +27 -27
- package/internal/index.cjs.map +1 -1
- package/internal/index.js +34 -28
- package/internal/index.js.map +1 -1
- package/package.json +5 -5
- package/CHANGELOG.md +0 -2301
- package/README.md +0 -697
package/index.d.cts
CHANGED
@@ -2056,22 +2056,30 @@ interface ToolCallsGenerationModel<PROMPT, SETTINGS extends ToolCallsGenerationM
|
|
2056
2056
|
}
|
2057
2057
|
|
2058
2058
|
interface ToolCallPromptTemplate<SOURCE_PROMPT, TARGET_PROMPT> {
|
2059
|
-
createPrompt
|
2060
|
-
extractToolCall
|
2059
|
+
createPrompt(prompt: SOURCE_PROMPT, tool: ToolDefinition<string, unknown>): TARGET_PROMPT;
|
2060
|
+
extractToolCall(response: string, tool: ToolDefinition<string, unknown>): {
|
2061
2061
|
id: string;
|
2062
2062
|
args: unknown;
|
2063
2063
|
} | null;
|
2064
|
+
withJsonOutput?({ model, schema, }: {
|
2065
|
+
model: {
|
2066
|
+
withJsonOutput(schema: Schema<unknown> & JsonSchemaProducer): typeof model;
|
2067
|
+
};
|
2068
|
+
schema: Schema<unknown> & JsonSchemaProducer;
|
2069
|
+
}): typeof model;
|
2064
2070
|
}
|
2071
|
+
|
2065
2072
|
declare class TextGenerationToolCallModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL extends TextGenerationModel<TARGET_PROMPT, TextGenerationModelSettings>> implements ToolCallGenerationModel<SOURCE_PROMPT, MODEL["settings"]> {
|
2066
2073
|
private readonly model;
|
2067
|
-
private readonly
|
2068
|
-
constructor({ model,
|
2074
|
+
private readonly template;
|
2075
|
+
constructor({ model, template, }: {
|
2069
2076
|
model: MODEL;
|
2070
|
-
|
2077
|
+
template: ToolCallPromptTemplate<SOURCE_PROMPT, TARGET_PROMPT>;
|
2071
2078
|
});
|
2072
2079
|
get modelInformation(): ModelInformation;
|
2073
2080
|
get settings(): TextGenerationModelSettings;
|
2074
2081
|
get settingsForEvent(): Partial<MODEL["settings"]>;
|
2082
|
+
getModelWithJsonOutput(schema: Schema<unknown> & JsonSchemaProducer): MODEL;
|
2075
2083
|
doGenerateToolCall(tool: ToolDefinition<string, unknown>, prompt: SOURCE_PROMPT, options?: FunctionOptions): Promise<{
|
2076
2084
|
rawResponse: unknown;
|
2077
2085
|
toolCall: {
|
@@ -9131,9 +9139,9 @@ declare class Tool<NAME extends string, PARAMETERS, RESULT> implements ToolDefin
|
|
9131
9139
|
*/
|
9132
9140
|
readonly name: NAME;
|
9133
9141
|
/**
|
9134
|
-
* A description of what the tool does. Will be used by the language model to decide whether to use the tool.
|
9142
|
+
* A optional description of what the tool does. Will be used by the language model to decide whether to use the tool.
|
9135
9143
|
*/
|
9136
|
-
readonly description
|
9144
|
+
readonly description?: string;
|
9137
9145
|
/**
|
9138
9146
|
* The schema of the input that the tool expects. The language model will use this to generate the input.
|
9139
9147
|
* Use descriptions to make the input understandable for the language model.
|
@@ -9149,13 +9157,28 @@ declare class Tool<NAME extends string, PARAMETERS, RESULT> implements ToolDefin
|
|
9149
9157
|
readonly execute: (args: PARAMETERS, options: FunctionCallOptions) => PromiseLike<RESULT>;
|
9150
9158
|
constructor({ name, description, parameters, returnType, execute, }: {
|
9151
9159
|
name: NAME;
|
9152
|
-
description
|
9160
|
+
description?: string;
|
9153
9161
|
parameters: Schema<PARAMETERS> & JsonSchemaProducer;
|
9154
9162
|
returnType?: Schema<RESULT>;
|
9155
9163
|
execute(args: PARAMETERS, options?: FunctionOptions): PromiseLike<RESULT>;
|
9156
9164
|
});
|
9157
9165
|
}
|
9158
9166
|
|
9167
|
+
/**
|
9168
|
+
* A tool that generates an object. You can configure it with a model, an input, an output schema, and a prompt.
|
9169
|
+
*/
|
9170
|
+
declare class ObjectGeneratorTool<NAME extends string, PROMPT, PARAMETERS, OBJECT> extends Tool<NAME, PARAMETERS, OBJECT> {
|
9171
|
+
constructor({ name, // eslint-disable-line @typescript-eslint/no-explicit-any
|
9172
|
+
description, model, parameters, objectSchema, prompt, }: {
|
9173
|
+
name?: NAME;
|
9174
|
+
description?: string;
|
9175
|
+
model: ObjectGenerationModel<PROMPT, ObjectGenerationModelSettings>;
|
9176
|
+
parameters: Schema<PARAMETERS> & JsonSchemaProducer;
|
9177
|
+
objectSchema: Schema<OBJECT> & JsonSchemaProducer;
|
9178
|
+
prompt: (input: PARAMETERS) => PromptFunction<PARAMETERS, PROMPT>;
|
9179
|
+
});
|
9180
|
+
}
|
9181
|
+
|
9159
9182
|
/**
|
9160
9183
|
* Thrown when the arguments of a tool call are invalid.
|
9161
9184
|
*
|
@@ -9262,7 +9285,7 @@ declare class WebSearchTool<NAME extends string> extends Tool<NAME, WebSearchToo
|
|
9262
9285
|
readonly returnType: typeof RETURN_TYPE_SCHEMA;
|
9263
9286
|
constructor({ name, description, queryDescription, execute, }: {
|
9264
9287
|
name: NAME;
|
9265
|
-
description
|
9288
|
+
description?: string;
|
9266
9289
|
queryDescription?: string;
|
9267
9290
|
execute(input: WebSearchToolInput, options?: FunctionOptions): PromiseLike<WebSearchToolOutput>;
|
9268
9291
|
});
|
@@ -9334,7 +9357,12 @@ declare function generateToolCall<PARAMETERS, PROMPT, NAME extends string, SETTI
|
|
9334
9357
|
}>;
|
9335
9358
|
|
9336
9359
|
declare const jsonToolCallPrompt: {
|
9337
|
-
text(
|
9360
|
+
text({ toolPrompt, }?: {
|
9361
|
+
toolPrompt?: ((tool: ToolDefinition<string, unknown>) => string) | undefined;
|
9362
|
+
}): ToolCallPromptTemplate<string, InstructionPrompt>;
|
9363
|
+
instruction({ toolPrompt, }?: {
|
9364
|
+
toolPrompt?: ((tool: ToolDefinition<string, unknown>) => string) | undefined;
|
9365
|
+
}): ToolCallPromptTemplate<InstructionPrompt, InstructionPrompt>;
|
9338
9366
|
};
|
9339
9367
|
|
9340
9368
|
declare class ToolCallsParseError extends Error {
|
@@ -9516,4 +9544,4 @@ declare function upsertIntoVectorIndex<VALUE, OBJECT>({ vectorIndex, embeddingMo
|
|
9516
9544
|
getId?: (object: OBJECT, index: number) => string | undefined;
|
9517
9545
|
}, options?: FunctionOptions): Promise<void>;
|
9518
9546
|
|
9519
|
-
export { AbortError, AbstractOpenAIChatModel, type AbstractOpenAIChatSettings, AbstractOpenAICompletionModel, type AbstractOpenAICompletionModelSettings, AbstractOpenAITextEmbeddingModel, type AbstractOpenAITextEmbeddingModelSettings, AlpacaPromptTemplate as AlpacaPrompt, ApiCallError, type ApiConfiguration, type AssistantContent, AsyncQueue, type AudioMimeType, Automatic1111ApiConfiguration, type Automatic1111ErrorData, Automatic1111ImageGenerationModel, type Automatic1111ImageGenerationPrompt, type Automatic1111ImageGenerationResponse, type Automatic1111ImageGenerationSettings, AzureOpenAIApiConfiguration, type AzureOpenAIApiConfigurationOptions, type BaseFunctionEvent, type BaseFunctionFinishedEvent, type BaseFunctionFinishedEventResult, type BaseFunctionStartedEvent, type BaseModelCallFinishedEvent, type BaseModelCallFinishedEventResult, type BaseModelCallStartedEvent, BaseUrlApiConfiguration, BaseUrlApiConfigurationWithDefaults, type BaseUrlPartsApiConfigurationOptions, type BasicTokenizer, COHERE_TEXT_EMBEDDING_MODELS, COHERE_TEXT_GENERATION_MODELS, type Cache, ChatMLPromptTemplate as ChatMLPrompt, ChatMessage, type ChatPrompt, type Classifier, type ClassifierSettings, type ClassifyFinishedEvent, type ClassifyFinishedEventResult, type ClassifyStartedEvent, CohereApiConfiguration, type CohereDetokenizationResponse, type CohereErrorData, CohereTextEmbeddingModel, type CohereTextEmbeddingModelSettings, type CohereTextEmbeddingModelType, type CohereTextEmbeddingResponse, CohereTextGenerationModel, type CohereTextGenerationModelSettings, type CohereTextGenerationModelType, type CohereTextGenerationResponse, CohereTextGenerationResponseFormat, type CohereTextGenerationResponseFormatType, type CohereTextStreamChunk, type CohereTokenizationResponse, CohereTokenizer, type CohereTokenizerModelType, type CohereTokenizerSettings, type CustomHeaderProvider, type DataContent, DefaultRun, type Delta, ElevenLabsApiConfiguration, ElevenLabsSpeechModel, type ElevenLabsSpeechModelSettings, type EmbeddingFinishedEvent, type EmbeddingFinishedEventResult, type EmbeddingModel, type EmbeddingModelSettings, EmbeddingSimilarityClassifier, type EmbeddingSimilarityClassifierSettings, type EmbeddingStartedEvent, type ExecuteFunctionFinishedEvent, type ExecuteFunctionStartedEvent, type ExecuteToolFinishedEvent, type ExecuteToolMetadata, type ExecuteToolStartedEvent, FireworksAIApiConfiguration, type FlexibleObjectFromTextPromptTemplate, type FullTokenizer, type FunctionCallOptions, type FunctionEvent, FunctionEventSource, type FunctionObserver, type FunctionOptions, type HasContextWindowSize, type HasTokenizer, type HeaderParameters, HeliconeOpenAIApiConfiguration, HuggingFaceApiConfiguration, type HuggingFaceErrorData, HuggingFaceTextEmbeddingModel, type HuggingFaceTextEmbeddingModelSettings, type HuggingFaceTextEmbeddingResponse, HuggingFaceTextGenerationModel, type HuggingFaceTextGenerationModelSettings, type HuggingFaceTextGenerationResponse, type ImageGenerationFinishedEvent, type ImageGenerationFinishedEventResult, type ImageGenerationModel, type ImageGenerationModelSettings, type ImageGenerationStartedEvent, type ImagePart, type InstructionContent, type InstructionPrompt, InvalidPromptError, JSONParseError, type JsonSchemaProducer, Llama2PromptTemplate as Llama2Prompt, LlamaCppApiConfiguration, LlamaCppCompletionModel, type LlamaCppCompletionModelSettings, type LlamaCppCompletionPrompt, LlamaCppCompletionResponseFormat, type LlamaCppCompletionResponseFormatType, type LlamaCppErrorData, LlamaCppTextEmbeddingModel, type LlamaCppTextEmbeddingModelSettings, type LlamaCppTextEmbeddingResponse, type LlamaCppTextGenerationResponse, type LlamaCppTextStreamChunk, type LlamaCppTokenizationResponse, LlamaCppTokenizer, LmntApiConfiguration, LmntSpeechModel, type LmntSpeechModelSettings, type LmntSpeechResponse, type LogFormat, MemoryCache, MemoryVectorIndex, MistralApiConfiguration, type MistralChatMessage, MistralChatModel, type MistralChatModelSettings, type MistralChatPrompt, type MistralChatResponse, MistralChatResponseFormat, type MistralChatResponseFormatType, type MistralChatStreamChunk, type MistralErrorData, MistralInstructPromptTemplate as MistralInstructPrompt, MistralTextEmbeddingModel, type MistralTextEmbeddingModelSettings, type MistralTextEmbeddingResponse, type Model, type ModelCallFinishedEvent, type ModelCallMetadata, type ModelCallStartedEvent, type ModelInformation, type ModelSettings, NeuralChatPromptTemplate as NeuralChatPrompt, NoSuchToolDefinitionError, OPENAI_CHAT_MESSAGE_BASE_TOKEN_COUNT, OPENAI_CHAT_MODELS, OPENAI_CHAT_PROMPT_BASE_TOKEN_COUNT, OPENAI_IMAGE_MODELS, OPENAI_SPEECH_MODELS, OPENAI_TEXT_EMBEDDING_MODELS, OPENAI_TEXT_GENERATION_MODELS, OPENAI_TRANSCRIPTION_MODELS, ObjectFromTextGenerationModel, type ObjectFromTextPromptTemplate, ObjectFromTextStreamingModel, type ObjectGenerationFinishedEvent, type ObjectGenerationFinishedEventResult, type ObjectGenerationModel, type ObjectGenerationModelSettings, type ObjectGenerationStartedEvent, ObjectParseError, type ObjectStream, ObjectStreamFromResponse, ObjectStreamResponse, type ObjectStreamingFinishedEvent, type ObjectStreamingModel, type ObjectStreamingStartedEvent, ObjectValidationError, OllamaApiConfiguration, type OllamaChatMessage, OllamaChatModel, type OllamaChatModelSettings, type OllamaChatPrompt, type OllamaChatResponse, OllamaChatResponseFormat, type OllamaChatResponseFormatType, type OllamaChatStreamChunk, OllamaCompletionModel, type OllamaCompletionModelSettings, type OllamaCompletionPrompt$1 as OllamaCompletionPrompt, type OllamaCompletionResponse, OllamaCompletionResponseFormat, type OllamaCompletionResponseFormatType, type OllamaCompletionStreamChunk, type OllamaErrorData, OllamaTextEmbeddingModel, type OllamaTextEmbeddingModelSettings, type OllamaTextEmbeddingResponse, type OllamaTextGenerationSettings, OpenAIApiConfiguration, type OpenAIChatBaseModelType, type OpenAIChatChunk, OpenAIChatMessage, OpenAIChatModel, type OpenAIChatModelType, type OpenAIChatPrompt, type OpenAIChatResponse, OpenAIChatResponseFormat, type OpenAIChatResponseFormatType, type OpenAIChatSettings, type OpenAICompatibleApiConfiguration, OpenAICompatibleChatModel, type OpenAICompatibleChatSettings, OpenAICompatibleCompletionModel, type OpenAICompatibleCompletionModelSettings, type OpenAICompatibleProviderName, OpenAICompatibleTextEmbeddingModel, type OpenAICompatibleTextEmbeddingModelSettings, OpenAICompletionModel, type OpenAICompletionModelSettings, type OpenAICompletionModelType, type OpenAICompletionResponse, type OpenAIErrorData, type OpenAIImageGenerationBase64JsonResponse, type OpenAIImageGenerationCallSettings, OpenAIImageGenerationModel, OpenAIImageGenerationResponseFormat, type OpenAIImageGenerationResponseFormatType, type OpenAIImageGenerationSettings, type OpenAIImageGenerationUrlResponse, type OpenAIImageModelType, OpenAISpeechModel, type OpenAISpeechModelSettings, type OpenAISpeechModelType, type OpenAISpeechVoice, OpenAITextEmbeddingModel, type OpenAITextEmbeddingModelSettings, type OpenAITextEmbeddingModelType, type OpenAITextEmbeddingResponse, OpenAITextResponseFormat, type OpenAITextResponseFormatType, type OpenAITranscriptionJsonResponse, OpenAITranscriptionModel, type OpenAITranscriptionModelSettings, type OpenAITranscriptionModelType, OpenAITranscriptionResponseFormat, type OpenAITranscriptionResponseFormatType, type OpenAITranscriptionVerboseJsonResponse, type PartialBaseUrlPartsApiConfigurationOptions, PerplexityApiConfiguration, type PromptFunction, type PromptTemplate, PromptTemplateFullTextModel, PromptTemplateImageGenerationModel, PromptTemplateTextGenerationModel, PromptTemplateTextStreamingModel, type Retriever, RetryError, type RetryErrorReason, type RetryFunction, type Run, type Schema, type SpeechGenerationFinishedEvent, type SpeechGenerationFinishedEventResult, type SpeechGenerationModel, type SpeechGenerationModelSettings, type SpeechGenerationStartedEvent, type SpeechStreamingFinishedEvent, type SpeechStreamingStartedEvent, type SplitFunction, StabilityApiConfiguration, type StabilityClipGuidancePreset, type StabilityErrorData, StabilityImageGenerationModel, type StabilityImageGenerationModelType, type StabilityImageGenerationPrompt, type StabilityImageGenerationResponse, type StabilityImageGenerationSampler, type StabilityImageGenerationSettings, type StabilityImageGenerationStylePreset, type StreamingSpeechGenerationModel, SynthiaPromptTemplate as SynthiaPrompt, type TextChunk, type TextGenerationBaseModel, type TextGenerationFinishReason, type TextGenerationFinishedEvent, type TextGenerationFinishedEventResult, type TextGenerationModel, type TextGenerationModelSettings, type TextGenerationPromptTemplate, type TextGenerationPromptTemplateProvider, type TextGenerationResult, type TextGenerationStartedEvent, TextGenerationToolCallModel, TextGenerationToolCallsModel, type TextPart, TextPromptTemplate as TextPrompt, type TextStreamingBaseModel, type TextStreamingFinishedEvent, type TextStreamingModel, type TextStreamingStartedEvent, type ThrottleFunction, TikTokenTokenizer, type TikTokenTokenizerSettings, TogetherAIApiConfiguration, Tool, type ToolCall, ToolCallArgumentsValidationError, ToolCallError, ToolCallGenerationError, type ToolCallGenerationFinishedEvent, type ToolCallGenerationFinishedEventResult, type ToolCallGenerationModel, type ToolCallGenerationModelSettings, type ToolCallGenerationStartedEvent, ToolCallParseError, type ToolCallPart, type ToolCallPromptTemplate, type ToolCallResult, type ToolCallsGenerationFinishedEvent, type ToolCallsGenerationFinishedEventResult, type ToolCallsGenerationModel, type ToolCallsGenerationModelSettings, type ToolCallsGenerationStartedEvent, ToolCallsParseError, type ToolCallsPromptTemplate, type ToolContent, type ToolDefinition, ToolExecutionError, type ToolResponsePart, type TranscriptionFinishedEvent, type TranscriptionFinishedEventResult, type TranscriptionModel, type TranscriptionModelSettings, type TranscriptionStartedEvent, TypeValidationError, UncheckedSchema, type UpsertIntoVectorIndexFinishedEvent, type UpsertIntoVectorIndexStartedEvent, type UrlParts, type UserContent, type ValueCluster, type Vector, type VectorIndex, VectorIndexRetriever, type VectorIndexRetrieverSettings, VicunaPromptTemplate as VicunaPrompt, WebSearchTool, type WebSearchToolInput, type WebSearchToolOutput, WhisperCppApiConfiguration, WhisperCppTranscriptionModel, type WhisperCppTranscriptionModelSettings, ZodSchema, ApiFacade as api, Automatic1111Facade as automatic1111, calculateOpenAIChatCostInMillicents, calculateOpenAICompletionCostInMillicents, calculateOpenAIEmbeddingCostInMillicents, calculateOpenAIImageGenerationCostInMillicents, calculateOpenAISpeechCostInMillicents, calculateOpenAITranscriptionCostInMillicents, classify, CohereFacade as cohere, convertDataContentToBase64String, convertDataContentToUint8Array, cosineSimilarity, countOpenAIChatMessageTokens, countOpenAIChatPromptTokens, countTokens, createChatPrompt, createEventSourceStream, createInstructionPrompt, createTextPrompt, delay, ElevenLabsFacade as elevenlabs, embed, embedMany, executeFunction, executeTool, generateImage, generateObject, generateSpeech, generateText, generateToolCall, generateToolCalls, generateTranscription, getAudioFileExtension, getOpenAIChatModelInformation, getOpenAICompletionModelInformation, getRun, HuggingFaceFacade as huggingface, isOpenAIChatModel, isOpenAICompletionModel, isOpenAIEmbeddingModel, isPromptFunction, jsonObjectPrompt, jsonToolCallPrompt, LlamaCppFacade as llamacpp, LmntFacade as lmnt, mapBasicPromptToAutomatic1111Format, mapBasicPromptToStabilityFormat, markAsPromptFunction, MistralFacade as mistral, ModelFusionConfiguration as modelfusion, OllamaFacade as ollama, OpenAIFacade as openai, OpenAICompatibleFacade as openaicompatible, parseJSON, retrieve, retryNever, retryWithExponentialBackoff, runTool, type runToolFinishedEvent, type runToolStartedEvent, runTools, type runToolsFinishedEvent, type runToolsStartedEvent, safeParseJSON, safeValidateTypes, splitAtCharacter, splitAtToken, splitOnSeparator, splitTextChunk, splitTextChunks, StabilityFacade as stability, streamObject, streamSpeech, streamText, textGenerationModelProperties, throttleMaxConcurrency, throttleOff, trimChatPrompt, uncheckedSchema, upsertIntoVectorIndex, validateContentIsString, validateTypes, WhisperCppFacade as whispercpp, withRun, zodSchema };
|
9547
|
+
export { AbortError, AbstractOpenAIChatModel, type AbstractOpenAIChatSettings, AbstractOpenAICompletionModel, type AbstractOpenAICompletionModelSettings, AbstractOpenAITextEmbeddingModel, type AbstractOpenAITextEmbeddingModelSettings, AlpacaPromptTemplate as AlpacaPrompt, ApiCallError, type ApiConfiguration, type AssistantContent, AsyncQueue, type AudioMimeType, Automatic1111ApiConfiguration, type Automatic1111ErrorData, Automatic1111ImageGenerationModel, type Automatic1111ImageGenerationPrompt, type Automatic1111ImageGenerationResponse, type Automatic1111ImageGenerationSettings, AzureOpenAIApiConfiguration, type AzureOpenAIApiConfigurationOptions, type BaseFunctionEvent, type BaseFunctionFinishedEvent, type BaseFunctionFinishedEventResult, type BaseFunctionStartedEvent, type BaseModelCallFinishedEvent, type BaseModelCallFinishedEventResult, type BaseModelCallStartedEvent, BaseUrlApiConfiguration, BaseUrlApiConfigurationWithDefaults, type BaseUrlPartsApiConfigurationOptions, type BasicTokenizer, COHERE_TEXT_EMBEDDING_MODELS, COHERE_TEXT_GENERATION_MODELS, type Cache, ChatMLPromptTemplate as ChatMLPrompt, ChatMessage, type ChatPrompt, type Classifier, type ClassifierSettings, type ClassifyFinishedEvent, type ClassifyFinishedEventResult, type ClassifyStartedEvent, CohereApiConfiguration, type CohereDetokenizationResponse, type CohereErrorData, CohereTextEmbeddingModel, type CohereTextEmbeddingModelSettings, type CohereTextEmbeddingModelType, type CohereTextEmbeddingResponse, CohereTextGenerationModel, type CohereTextGenerationModelSettings, type CohereTextGenerationModelType, type CohereTextGenerationResponse, CohereTextGenerationResponseFormat, type CohereTextGenerationResponseFormatType, type CohereTextStreamChunk, type CohereTokenizationResponse, CohereTokenizer, type CohereTokenizerModelType, type CohereTokenizerSettings, type CustomHeaderProvider, type DataContent, DefaultRun, type Delta, ElevenLabsApiConfiguration, ElevenLabsSpeechModel, type ElevenLabsSpeechModelSettings, type EmbeddingFinishedEvent, type EmbeddingFinishedEventResult, type EmbeddingModel, type EmbeddingModelSettings, EmbeddingSimilarityClassifier, type EmbeddingSimilarityClassifierSettings, type EmbeddingStartedEvent, type ExecuteFunctionFinishedEvent, type ExecuteFunctionStartedEvent, type ExecuteToolFinishedEvent, type ExecuteToolMetadata, type ExecuteToolStartedEvent, FireworksAIApiConfiguration, type FlexibleObjectFromTextPromptTemplate, type FullTokenizer, type FunctionCallOptions, type FunctionEvent, FunctionEventSource, type FunctionObserver, type FunctionOptions, type HasContextWindowSize, type HasTokenizer, type HeaderParameters, HeliconeOpenAIApiConfiguration, HuggingFaceApiConfiguration, type HuggingFaceErrorData, HuggingFaceTextEmbeddingModel, type HuggingFaceTextEmbeddingModelSettings, type HuggingFaceTextEmbeddingResponse, HuggingFaceTextGenerationModel, type HuggingFaceTextGenerationModelSettings, type HuggingFaceTextGenerationResponse, type ImageGenerationFinishedEvent, type ImageGenerationFinishedEventResult, type ImageGenerationModel, type ImageGenerationModelSettings, type ImageGenerationStartedEvent, type ImagePart, type InstructionContent, type InstructionPrompt, InvalidPromptError, JSONParseError, type JsonSchemaProducer, Llama2PromptTemplate as Llama2Prompt, LlamaCppApiConfiguration, LlamaCppCompletionModel, type LlamaCppCompletionModelSettings, type LlamaCppCompletionPrompt, LlamaCppCompletionResponseFormat, type LlamaCppCompletionResponseFormatType, type LlamaCppErrorData, LlamaCppTextEmbeddingModel, type LlamaCppTextEmbeddingModelSettings, type LlamaCppTextEmbeddingResponse, type LlamaCppTextGenerationResponse, type LlamaCppTextStreamChunk, type LlamaCppTokenizationResponse, LlamaCppTokenizer, LmntApiConfiguration, LmntSpeechModel, type LmntSpeechModelSettings, type LmntSpeechResponse, type LogFormat, MemoryCache, MemoryVectorIndex, MistralApiConfiguration, type MistralChatMessage, MistralChatModel, type MistralChatModelSettings, type MistralChatPrompt, type MistralChatResponse, MistralChatResponseFormat, type MistralChatResponseFormatType, type MistralChatStreamChunk, type MistralErrorData, MistralInstructPromptTemplate as MistralInstructPrompt, MistralTextEmbeddingModel, type MistralTextEmbeddingModelSettings, type MistralTextEmbeddingResponse, type Model, type ModelCallFinishedEvent, type ModelCallMetadata, type ModelCallStartedEvent, type ModelInformation, type ModelSettings, NeuralChatPromptTemplate as NeuralChatPrompt, NoSuchToolDefinitionError, OPENAI_CHAT_MESSAGE_BASE_TOKEN_COUNT, OPENAI_CHAT_MODELS, OPENAI_CHAT_PROMPT_BASE_TOKEN_COUNT, OPENAI_IMAGE_MODELS, OPENAI_SPEECH_MODELS, OPENAI_TEXT_EMBEDDING_MODELS, OPENAI_TEXT_GENERATION_MODELS, OPENAI_TRANSCRIPTION_MODELS, ObjectFromTextGenerationModel, type ObjectFromTextPromptTemplate, ObjectFromTextStreamingModel, type ObjectGenerationFinishedEvent, type ObjectGenerationFinishedEventResult, type ObjectGenerationModel, type ObjectGenerationModelSettings, type ObjectGenerationStartedEvent, ObjectGeneratorTool, ObjectParseError, type ObjectStream, ObjectStreamFromResponse, ObjectStreamResponse, type ObjectStreamingFinishedEvent, type ObjectStreamingModel, type ObjectStreamingStartedEvent, ObjectValidationError, OllamaApiConfiguration, type OllamaChatMessage, OllamaChatModel, type OllamaChatModelSettings, type OllamaChatPrompt, type OllamaChatResponse, OllamaChatResponseFormat, type OllamaChatResponseFormatType, type OllamaChatStreamChunk, OllamaCompletionModel, type OllamaCompletionModelSettings, type OllamaCompletionPrompt$1 as OllamaCompletionPrompt, type OllamaCompletionResponse, OllamaCompletionResponseFormat, type OllamaCompletionResponseFormatType, type OllamaCompletionStreamChunk, type OllamaErrorData, OllamaTextEmbeddingModel, type OllamaTextEmbeddingModelSettings, type OllamaTextEmbeddingResponse, type OllamaTextGenerationSettings, OpenAIApiConfiguration, type OpenAIChatBaseModelType, type OpenAIChatChunk, OpenAIChatMessage, OpenAIChatModel, type OpenAIChatModelType, type OpenAIChatPrompt, type OpenAIChatResponse, OpenAIChatResponseFormat, type OpenAIChatResponseFormatType, type OpenAIChatSettings, type OpenAICompatibleApiConfiguration, OpenAICompatibleChatModel, type OpenAICompatibleChatSettings, OpenAICompatibleCompletionModel, type OpenAICompatibleCompletionModelSettings, type OpenAICompatibleProviderName, OpenAICompatibleTextEmbeddingModel, type OpenAICompatibleTextEmbeddingModelSettings, OpenAICompletionModel, type OpenAICompletionModelSettings, type OpenAICompletionModelType, type OpenAICompletionResponse, type OpenAIErrorData, type OpenAIImageGenerationBase64JsonResponse, type OpenAIImageGenerationCallSettings, OpenAIImageGenerationModel, OpenAIImageGenerationResponseFormat, type OpenAIImageGenerationResponseFormatType, type OpenAIImageGenerationSettings, type OpenAIImageGenerationUrlResponse, type OpenAIImageModelType, OpenAISpeechModel, type OpenAISpeechModelSettings, type OpenAISpeechModelType, type OpenAISpeechVoice, OpenAITextEmbeddingModel, type OpenAITextEmbeddingModelSettings, type OpenAITextEmbeddingModelType, type OpenAITextEmbeddingResponse, OpenAITextResponseFormat, type OpenAITextResponseFormatType, type OpenAITranscriptionJsonResponse, OpenAITranscriptionModel, type OpenAITranscriptionModelSettings, type OpenAITranscriptionModelType, OpenAITranscriptionResponseFormat, type OpenAITranscriptionResponseFormatType, type OpenAITranscriptionVerboseJsonResponse, type PartialBaseUrlPartsApiConfigurationOptions, PerplexityApiConfiguration, type PromptFunction, type PromptTemplate, PromptTemplateFullTextModel, PromptTemplateImageGenerationModel, PromptTemplateTextGenerationModel, PromptTemplateTextStreamingModel, type Retriever, RetryError, type RetryErrorReason, type RetryFunction, type Run, type Schema, type SpeechGenerationFinishedEvent, type SpeechGenerationFinishedEventResult, type SpeechGenerationModel, type SpeechGenerationModelSettings, type SpeechGenerationStartedEvent, type SpeechStreamingFinishedEvent, type SpeechStreamingStartedEvent, type SplitFunction, StabilityApiConfiguration, type StabilityClipGuidancePreset, type StabilityErrorData, StabilityImageGenerationModel, type StabilityImageGenerationModelType, type StabilityImageGenerationPrompt, type StabilityImageGenerationResponse, type StabilityImageGenerationSampler, type StabilityImageGenerationSettings, type StabilityImageGenerationStylePreset, type StreamingSpeechGenerationModel, SynthiaPromptTemplate as SynthiaPrompt, type TextChunk, type TextGenerationBaseModel, type TextGenerationFinishReason, type TextGenerationFinishedEvent, type TextGenerationFinishedEventResult, type TextGenerationModel, type TextGenerationModelSettings, type TextGenerationPromptTemplate, type TextGenerationPromptTemplateProvider, type TextGenerationResult, type TextGenerationStartedEvent, TextGenerationToolCallModel, TextGenerationToolCallsModel, type TextPart, TextPromptTemplate as TextPrompt, type TextStreamingBaseModel, type TextStreamingFinishedEvent, type TextStreamingModel, type TextStreamingStartedEvent, type ThrottleFunction, TikTokenTokenizer, type TikTokenTokenizerSettings, TogetherAIApiConfiguration, Tool, type ToolCall, ToolCallArgumentsValidationError, ToolCallError, ToolCallGenerationError, type ToolCallGenerationFinishedEvent, type ToolCallGenerationFinishedEventResult, type ToolCallGenerationModel, type ToolCallGenerationModelSettings, type ToolCallGenerationStartedEvent, ToolCallParseError, type ToolCallPart, type ToolCallPromptTemplate, type ToolCallResult, type ToolCallsGenerationFinishedEvent, type ToolCallsGenerationFinishedEventResult, type ToolCallsGenerationModel, type ToolCallsGenerationModelSettings, type ToolCallsGenerationStartedEvent, ToolCallsParseError, type ToolCallsPromptTemplate, type ToolContent, type ToolDefinition, ToolExecutionError, type ToolResponsePart, type TranscriptionFinishedEvent, type TranscriptionFinishedEventResult, type TranscriptionModel, type TranscriptionModelSettings, type TranscriptionStartedEvent, TypeValidationError, UncheckedSchema, type UpsertIntoVectorIndexFinishedEvent, type UpsertIntoVectorIndexStartedEvent, type UrlParts, type UserContent, type ValueCluster, type Vector, type VectorIndex, VectorIndexRetriever, type VectorIndexRetrieverSettings, VicunaPromptTemplate as VicunaPrompt, WebSearchTool, type WebSearchToolInput, type WebSearchToolOutput, WhisperCppApiConfiguration, WhisperCppTranscriptionModel, type WhisperCppTranscriptionModelSettings, ZodSchema, ApiFacade as api, Automatic1111Facade as automatic1111, calculateOpenAIChatCostInMillicents, calculateOpenAICompletionCostInMillicents, calculateOpenAIEmbeddingCostInMillicents, calculateOpenAIImageGenerationCostInMillicents, calculateOpenAISpeechCostInMillicents, calculateOpenAITranscriptionCostInMillicents, classify, CohereFacade as cohere, convertDataContentToBase64String, convertDataContentToUint8Array, cosineSimilarity, countOpenAIChatMessageTokens, countOpenAIChatPromptTokens, countTokens, createChatPrompt, createEventSourceStream, createInstructionPrompt, createTextPrompt, delay, ElevenLabsFacade as elevenlabs, embed, embedMany, executeFunction, executeTool, generateImage, generateObject, generateSpeech, generateText, generateToolCall, generateToolCalls, generateTranscription, getAudioFileExtension, getOpenAIChatModelInformation, getOpenAICompletionModelInformation, getRun, HuggingFaceFacade as huggingface, isOpenAIChatModel, isOpenAICompletionModel, isOpenAIEmbeddingModel, isPromptFunction, jsonObjectPrompt, jsonToolCallPrompt, LlamaCppFacade as llamacpp, LmntFacade as lmnt, mapBasicPromptToAutomatic1111Format, mapBasicPromptToStabilityFormat, markAsPromptFunction, MistralFacade as mistral, ModelFusionConfiguration as modelfusion, OllamaFacade as ollama, OpenAIFacade as openai, OpenAICompatibleFacade as openaicompatible, parseJSON, retrieve, retryNever, retryWithExponentialBackoff, runTool, type runToolFinishedEvent, type runToolStartedEvent, runTools, type runToolsFinishedEvent, type runToolsStartedEvent, safeParseJSON, safeValidateTypes, splitAtCharacter, splitAtToken, splitOnSeparator, splitTextChunk, splitTextChunks, StabilityFacade as stability, streamObject, streamSpeech, streamText, textGenerationModelProperties, throttleMaxConcurrency, throttleOff, trimChatPrompt, uncheckedSchema, upsertIntoVectorIndex, validateContentIsString, validateTypes, WhisperCppFacade as whispercpp, withRun, zodSchema };
|
package/index.d.ts
CHANGED
@@ -2056,22 +2056,30 @@ interface ToolCallsGenerationModel<PROMPT, SETTINGS extends ToolCallsGenerationM
|
|
2056
2056
|
}
|
2057
2057
|
|
2058
2058
|
interface ToolCallPromptTemplate<SOURCE_PROMPT, TARGET_PROMPT> {
|
2059
|
-
createPrompt
|
2060
|
-
extractToolCall
|
2059
|
+
createPrompt(prompt: SOURCE_PROMPT, tool: ToolDefinition<string, unknown>): TARGET_PROMPT;
|
2060
|
+
extractToolCall(response: string, tool: ToolDefinition<string, unknown>): {
|
2061
2061
|
id: string;
|
2062
2062
|
args: unknown;
|
2063
2063
|
} | null;
|
2064
|
+
withJsonOutput?({ model, schema, }: {
|
2065
|
+
model: {
|
2066
|
+
withJsonOutput(schema: Schema<unknown> & JsonSchemaProducer): typeof model;
|
2067
|
+
};
|
2068
|
+
schema: Schema<unknown> & JsonSchemaProducer;
|
2069
|
+
}): typeof model;
|
2064
2070
|
}
|
2071
|
+
|
2065
2072
|
declare class TextGenerationToolCallModel<SOURCE_PROMPT, TARGET_PROMPT, MODEL extends TextGenerationModel<TARGET_PROMPT, TextGenerationModelSettings>> implements ToolCallGenerationModel<SOURCE_PROMPT, MODEL["settings"]> {
|
2066
2073
|
private readonly model;
|
2067
|
-
private readonly
|
2068
|
-
constructor({ model,
|
2074
|
+
private readonly template;
|
2075
|
+
constructor({ model, template, }: {
|
2069
2076
|
model: MODEL;
|
2070
|
-
|
2077
|
+
template: ToolCallPromptTemplate<SOURCE_PROMPT, TARGET_PROMPT>;
|
2071
2078
|
});
|
2072
2079
|
get modelInformation(): ModelInformation;
|
2073
2080
|
get settings(): TextGenerationModelSettings;
|
2074
2081
|
get settingsForEvent(): Partial<MODEL["settings"]>;
|
2082
|
+
getModelWithJsonOutput(schema: Schema<unknown> & JsonSchemaProducer): MODEL;
|
2075
2083
|
doGenerateToolCall(tool: ToolDefinition<string, unknown>, prompt: SOURCE_PROMPT, options?: FunctionOptions): Promise<{
|
2076
2084
|
rawResponse: unknown;
|
2077
2085
|
toolCall: {
|
@@ -9131,9 +9139,9 @@ declare class Tool<NAME extends string, PARAMETERS, RESULT> implements ToolDefin
|
|
9131
9139
|
*/
|
9132
9140
|
readonly name: NAME;
|
9133
9141
|
/**
|
9134
|
-
* A description of what the tool does. Will be used by the language model to decide whether to use the tool.
|
9142
|
+
* A optional description of what the tool does. Will be used by the language model to decide whether to use the tool.
|
9135
9143
|
*/
|
9136
|
-
readonly description
|
9144
|
+
readonly description?: string;
|
9137
9145
|
/**
|
9138
9146
|
* The schema of the input that the tool expects. The language model will use this to generate the input.
|
9139
9147
|
* Use descriptions to make the input understandable for the language model.
|
@@ -9149,13 +9157,28 @@ declare class Tool<NAME extends string, PARAMETERS, RESULT> implements ToolDefin
|
|
9149
9157
|
readonly execute: (args: PARAMETERS, options: FunctionCallOptions) => PromiseLike<RESULT>;
|
9150
9158
|
constructor({ name, description, parameters, returnType, execute, }: {
|
9151
9159
|
name: NAME;
|
9152
|
-
description
|
9160
|
+
description?: string;
|
9153
9161
|
parameters: Schema<PARAMETERS> & JsonSchemaProducer;
|
9154
9162
|
returnType?: Schema<RESULT>;
|
9155
9163
|
execute(args: PARAMETERS, options?: FunctionOptions): PromiseLike<RESULT>;
|
9156
9164
|
});
|
9157
9165
|
}
|
9158
9166
|
|
9167
|
+
/**
|
9168
|
+
* A tool that generates an object. You can configure it with a model, an input, an output schema, and a prompt.
|
9169
|
+
*/
|
9170
|
+
declare class ObjectGeneratorTool<NAME extends string, PROMPT, PARAMETERS, OBJECT> extends Tool<NAME, PARAMETERS, OBJECT> {
|
9171
|
+
constructor({ name, // eslint-disable-line @typescript-eslint/no-explicit-any
|
9172
|
+
description, model, parameters, objectSchema, prompt, }: {
|
9173
|
+
name?: NAME;
|
9174
|
+
description?: string;
|
9175
|
+
model: ObjectGenerationModel<PROMPT, ObjectGenerationModelSettings>;
|
9176
|
+
parameters: Schema<PARAMETERS> & JsonSchemaProducer;
|
9177
|
+
objectSchema: Schema<OBJECT> & JsonSchemaProducer;
|
9178
|
+
prompt: (input: PARAMETERS) => PromptFunction<PARAMETERS, PROMPT>;
|
9179
|
+
});
|
9180
|
+
}
|
9181
|
+
|
9159
9182
|
/**
|
9160
9183
|
* Thrown when the arguments of a tool call are invalid.
|
9161
9184
|
*
|
@@ -9262,7 +9285,7 @@ declare class WebSearchTool<NAME extends string> extends Tool<NAME, WebSearchToo
|
|
9262
9285
|
readonly returnType: typeof RETURN_TYPE_SCHEMA;
|
9263
9286
|
constructor({ name, description, queryDescription, execute, }: {
|
9264
9287
|
name: NAME;
|
9265
|
-
description
|
9288
|
+
description?: string;
|
9266
9289
|
queryDescription?: string;
|
9267
9290
|
execute(input: WebSearchToolInput, options?: FunctionOptions): PromiseLike<WebSearchToolOutput>;
|
9268
9291
|
});
|
@@ -9334,7 +9357,12 @@ declare function generateToolCall<PARAMETERS, PROMPT, NAME extends string, SETTI
|
|
9334
9357
|
}>;
|
9335
9358
|
|
9336
9359
|
declare const jsonToolCallPrompt: {
|
9337
|
-
text(
|
9360
|
+
text({ toolPrompt, }?: {
|
9361
|
+
toolPrompt?: ((tool: ToolDefinition<string, unknown>) => string) | undefined;
|
9362
|
+
}): ToolCallPromptTemplate<string, InstructionPrompt>;
|
9363
|
+
instruction({ toolPrompt, }?: {
|
9364
|
+
toolPrompt?: ((tool: ToolDefinition<string, unknown>) => string) | undefined;
|
9365
|
+
}): ToolCallPromptTemplate<InstructionPrompt, InstructionPrompt>;
|
9338
9366
|
};
|
9339
9367
|
|
9340
9368
|
declare class ToolCallsParseError extends Error {
|
@@ -9516,4 +9544,4 @@ declare function upsertIntoVectorIndex<VALUE, OBJECT>({ vectorIndex, embeddingMo
|
|
9516
9544
|
getId?: (object: OBJECT, index: number) => string | undefined;
|
9517
9545
|
}, options?: FunctionOptions): Promise<void>;
|
9518
9546
|
|
9519
|
-
export { AbortError, AbstractOpenAIChatModel, type AbstractOpenAIChatSettings, AbstractOpenAICompletionModel, type AbstractOpenAICompletionModelSettings, AbstractOpenAITextEmbeddingModel, type AbstractOpenAITextEmbeddingModelSettings, AlpacaPromptTemplate as AlpacaPrompt, ApiCallError, type ApiConfiguration, type AssistantContent, AsyncQueue, type AudioMimeType, Automatic1111ApiConfiguration, type Automatic1111ErrorData, Automatic1111ImageGenerationModel, type Automatic1111ImageGenerationPrompt, type Automatic1111ImageGenerationResponse, type Automatic1111ImageGenerationSettings, AzureOpenAIApiConfiguration, type AzureOpenAIApiConfigurationOptions, type BaseFunctionEvent, type BaseFunctionFinishedEvent, type BaseFunctionFinishedEventResult, type BaseFunctionStartedEvent, type BaseModelCallFinishedEvent, type BaseModelCallFinishedEventResult, type BaseModelCallStartedEvent, BaseUrlApiConfiguration, BaseUrlApiConfigurationWithDefaults, type BaseUrlPartsApiConfigurationOptions, type BasicTokenizer, COHERE_TEXT_EMBEDDING_MODELS, COHERE_TEXT_GENERATION_MODELS, type Cache, ChatMLPromptTemplate as ChatMLPrompt, ChatMessage, type ChatPrompt, type Classifier, type ClassifierSettings, type ClassifyFinishedEvent, type ClassifyFinishedEventResult, type ClassifyStartedEvent, CohereApiConfiguration, type CohereDetokenizationResponse, type CohereErrorData, CohereTextEmbeddingModel, type CohereTextEmbeddingModelSettings, type CohereTextEmbeddingModelType, type CohereTextEmbeddingResponse, CohereTextGenerationModel, type CohereTextGenerationModelSettings, type CohereTextGenerationModelType, type CohereTextGenerationResponse, CohereTextGenerationResponseFormat, type CohereTextGenerationResponseFormatType, type CohereTextStreamChunk, type CohereTokenizationResponse, CohereTokenizer, type CohereTokenizerModelType, type CohereTokenizerSettings, type CustomHeaderProvider, type DataContent, DefaultRun, type Delta, ElevenLabsApiConfiguration, ElevenLabsSpeechModel, type ElevenLabsSpeechModelSettings, type EmbeddingFinishedEvent, type EmbeddingFinishedEventResult, type EmbeddingModel, type EmbeddingModelSettings, EmbeddingSimilarityClassifier, type EmbeddingSimilarityClassifierSettings, type EmbeddingStartedEvent, type ExecuteFunctionFinishedEvent, type ExecuteFunctionStartedEvent, type ExecuteToolFinishedEvent, type ExecuteToolMetadata, type ExecuteToolStartedEvent, FireworksAIApiConfiguration, type FlexibleObjectFromTextPromptTemplate, type FullTokenizer, type FunctionCallOptions, type FunctionEvent, FunctionEventSource, type FunctionObserver, type FunctionOptions, type HasContextWindowSize, type HasTokenizer, type HeaderParameters, HeliconeOpenAIApiConfiguration, HuggingFaceApiConfiguration, type HuggingFaceErrorData, HuggingFaceTextEmbeddingModel, type HuggingFaceTextEmbeddingModelSettings, type HuggingFaceTextEmbeddingResponse, HuggingFaceTextGenerationModel, type HuggingFaceTextGenerationModelSettings, type HuggingFaceTextGenerationResponse, type ImageGenerationFinishedEvent, type ImageGenerationFinishedEventResult, type ImageGenerationModel, type ImageGenerationModelSettings, type ImageGenerationStartedEvent, type ImagePart, type InstructionContent, type InstructionPrompt, InvalidPromptError, JSONParseError, type JsonSchemaProducer, Llama2PromptTemplate as Llama2Prompt, LlamaCppApiConfiguration, LlamaCppCompletionModel, type LlamaCppCompletionModelSettings, type LlamaCppCompletionPrompt, LlamaCppCompletionResponseFormat, type LlamaCppCompletionResponseFormatType, type LlamaCppErrorData, LlamaCppTextEmbeddingModel, type LlamaCppTextEmbeddingModelSettings, type LlamaCppTextEmbeddingResponse, type LlamaCppTextGenerationResponse, type LlamaCppTextStreamChunk, type LlamaCppTokenizationResponse, LlamaCppTokenizer, LmntApiConfiguration, LmntSpeechModel, type LmntSpeechModelSettings, type LmntSpeechResponse, type LogFormat, MemoryCache, MemoryVectorIndex, MistralApiConfiguration, type MistralChatMessage, MistralChatModel, type MistralChatModelSettings, type MistralChatPrompt, type MistralChatResponse, MistralChatResponseFormat, type MistralChatResponseFormatType, type MistralChatStreamChunk, type MistralErrorData, MistralInstructPromptTemplate as MistralInstructPrompt, MistralTextEmbeddingModel, type MistralTextEmbeddingModelSettings, type MistralTextEmbeddingResponse, type Model, type ModelCallFinishedEvent, type ModelCallMetadata, type ModelCallStartedEvent, type ModelInformation, type ModelSettings, NeuralChatPromptTemplate as NeuralChatPrompt, NoSuchToolDefinitionError, OPENAI_CHAT_MESSAGE_BASE_TOKEN_COUNT, OPENAI_CHAT_MODELS, OPENAI_CHAT_PROMPT_BASE_TOKEN_COUNT, OPENAI_IMAGE_MODELS, OPENAI_SPEECH_MODELS, OPENAI_TEXT_EMBEDDING_MODELS, OPENAI_TEXT_GENERATION_MODELS, OPENAI_TRANSCRIPTION_MODELS, ObjectFromTextGenerationModel, type ObjectFromTextPromptTemplate, ObjectFromTextStreamingModel, type ObjectGenerationFinishedEvent, type ObjectGenerationFinishedEventResult, type ObjectGenerationModel, type ObjectGenerationModelSettings, type ObjectGenerationStartedEvent, ObjectParseError, type ObjectStream, ObjectStreamFromResponse, ObjectStreamResponse, type ObjectStreamingFinishedEvent, type ObjectStreamingModel, type ObjectStreamingStartedEvent, ObjectValidationError, OllamaApiConfiguration, type OllamaChatMessage, OllamaChatModel, type OllamaChatModelSettings, type OllamaChatPrompt, type OllamaChatResponse, OllamaChatResponseFormat, type OllamaChatResponseFormatType, type OllamaChatStreamChunk, OllamaCompletionModel, type OllamaCompletionModelSettings, type OllamaCompletionPrompt$1 as OllamaCompletionPrompt, type OllamaCompletionResponse, OllamaCompletionResponseFormat, type OllamaCompletionResponseFormatType, type OllamaCompletionStreamChunk, type OllamaErrorData, OllamaTextEmbeddingModel, type OllamaTextEmbeddingModelSettings, type OllamaTextEmbeddingResponse, type OllamaTextGenerationSettings, OpenAIApiConfiguration, type OpenAIChatBaseModelType, type OpenAIChatChunk, OpenAIChatMessage, OpenAIChatModel, type OpenAIChatModelType, type OpenAIChatPrompt, type OpenAIChatResponse, OpenAIChatResponseFormat, type OpenAIChatResponseFormatType, type OpenAIChatSettings, type OpenAICompatibleApiConfiguration, OpenAICompatibleChatModel, type OpenAICompatibleChatSettings, OpenAICompatibleCompletionModel, type OpenAICompatibleCompletionModelSettings, type OpenAICompatibleProviderName, OpenAICompatibleTextEmbeddingModel, type OpenAICompatibleTextEmbeddingModelSettings, OpenAICompletionModel, type OpenAICompletionModelSettings, type OpenAICompletionModelType, type OpenAICompletionResponse, type OpenAIErrorData, type OpenAIImageGenerationBase64JsonResponse, type OpenAIImageGenerationCallSettings, OpenAIImageGenerationModel, OpenAIImageGenerationResponseFormat, type OpenAIImageGenerationResponseFormatType, type OpenAIImageGenerationSettings, type OpenAIImageGenerationUrlResponse, type OpenAIImageModelType, OpenAISpeechModel, type OpenAISpeechModelSettings, type OpenAISpeechModelType, type OpenAISpeechVoice, OpenAITextEmbeddingModel, type OpenAITextEmbeddingModelSettings, type OpenAITextEmbeddingModelType, type OpenAITextEmbeddingResponse, OpenAITextResponseFormat, type OpenAITextResponseFormatType, type OpenAITranscriptionJsonResponse, OpenAITranscriptionModel, type OpenAITranscriptionModelSettings, type OpenAITranscriptionModelType, OpenAITranscriptionResponseFormat, type OpenAITranscriptionResponseFormatType, type OpenAITranscriptionVerboseJsonResponse, type PartialBaseUrlPartsApiConfigurationOptions, PerplexityApiConfiguration, type PromptFunction, type PromptTemplate, PromptTemplateFullTextModel, PromptTemplateImageGenerationModel, PromptTemplateTextGenerationModel, PromptTemplateTextStreamingModel, type Retriever, RetryError, type RetryErrorReason, type RetryFunction, type Run, type Schema, type SpeechGenerationFinishedEvent, type SpeechGenerationFinishedEventResult, type SpeechGenerationModel, type SpeechGenerationModelSettings, type SpeechGenerationStartedEvent, type SpeechStreamingFinishedEvent, type SpeechStreamingStartedEvent, type SplitFunction, StabilityApiConfiguration, type StabilityClipGuidancePreset, type StabilityErrorData, StabilityImageGenerationModel, type StabilityImageGenerationModelType, type StabilityImageGenerationPrompt, type StabilityImageGenerationResponse, type StabilityImageGenerationSampler, type StabilityImageGenerationSettings, type StabilityImageGenerationStylePreset, type StreamingSpeechGenerationModel, SynthiaPromptTemplate as SynthiaPrompt, type TextChunk, type TextGenerationBaseModel, type TextGenerationFinishReason, type TextGenerationFinishedEvent, type TextGenerationFinishedEventResult, type TextGenerationModel, type TextGenerationModelSettings, type TextGenerationPromptTemplate, type TextGenerationPromptTemplateProvider, type TextGenerationResult, type TextGenerationStartedEvent, TextGenerationToolCallModel, TextGenerationToolCallsModel, type TextPart, TextPromptTemplate as TextPrompt, type TextStreamingBaseModel, type TextStreamingFinishedEvent, type TextStreamingModel, type TextStreamingStartedEvent, type ThrottleFunction, TikTokenTokenizer, type TikTokenTokenizerSettings, TogetherAIApiConfiguration, Tool, type ToolCall, ToolCallArgumentsValidationError, ToolCallError, ToolCallGenerationError, type ToolCallGenerationFinishedEvent, type ToolCallGenerationFinishedEventResult, type ToolCallGenerationModel, type ToolCallGenerationModelSettings, type ToolCallGenerationStartedEvent, ToolCallParseError, type ToolCallPart, type ToolCallPromptTemplate, type ToolCallResult, type ToolCallsGenerationFinishedEvent, type ToolCallsGenerationFinishedEventResult, type ToolCallsGenerationModel, type ToolCallsGenerationModelSettings, type ToolCallsGenerationStartedEvent, ToolCallsParseError, type ToolCallsPromptTemplate, type ToolContent, type ToolDefinition, ToolExecutionError, type ToolResponsePart, type TranscriptionFinishedEvent, type TranscriptionFinishedEventResult, type TranscriptionModel, type TranscriptionModelSettings, type TranscriptionStartedEvent, TypeValidationError, UncheckedSchema, type UpsertIntoVectorIndexFinishedEvent, type UpsertIntoVectorIndexStartedEvent, type UrlParts, type UserContent, type ValueCluster, type Vector, type VectorIndex, VectorIndexRetriever, type VectorIndexRetrieverSettings, VicunaPromptTemplate as VicunaPrompt, WebSearchTool, type WebSearchToolInput, type WebSearchToolOutput, WhisperCppApiConfiguration, WhisperCppTranscriptionModel, type WhisperCppTranscriptionModelSettings, ZodSchema, ApiFacade as api, Automatic1111Facade as automatic1111, calculateOpenAIChatCostInMillicents, calculateOpenAICompletionCostInMillicents, calculateOpenAIEmbeddingCostInMillicents, calculateOpenAIImageGenerationCostInMillicents, calculateOpenAISpeechCostInMillicents, calculateOpenAITranscriptionCostInMillicents, classify, CohereFacade as cohere, convertDataContentToBase64String, convertDataContentToUint8Array, cosineSimilarity, countOpenAIChatMessageTokens, countOpenAIChatPromptTokens, countTokens, createChatPrompt, createEventSourceStream, createInstructionPrompt, createTextPrompt, delay, ElevenLabsFacade as elevenlabs, embed, embedMany, executeFunction, executeTool, generateImage, generateObject, generateSpeech, generateText, generateToolCall, generateToolCalls, generateTranscription, getAudioFileExtension, getOpenAIChatModelInformation, getOpenAICompletionModelInformation, getRun, HuggingFaceFacade as huggingface, isOpenAIChatModel, isOpenAICompletionModel, isOpenAIEmbeddingModel, isPromptFunction, jsonObjectPrompt, jsonToolCallPrompt, LlamaCppFacade as llamacpp, LmntFacade as lmnt, mapBasicPromptToAutomatic1111Format, mapBasicPromptToStabilityFormat, markAsPromptFunction, MistralFacade as mistral, ModelFusionConfiguration as modelfusion, OllamaFacade as ollama, OpenAIFacade as openai, OpenAICompatibleFacade as openaicompatible, parseJSON, retrieve, retryNever, retryWithExponentialBackoff, runTool, type runToolFinishedEvent, type runToolStartedEvent, runTools, type runToolsFinishedEvent, type runToolsStartedEvent, safeParseJSON, safeValidateTypes, splitAtCharacter, splitAtToken, splitOnSeparator, splitTextChunk, splitTextChunks, StabilityFacade as stability, streamObject, streamSpeech, streamText, textGenerationModelProperties, throttleMaxConcurrency, throttleOff, trimChatPrompt, uncheckedSchema, upsertIntoVectorIndex, validateContentIsString, validateTypes, WhisperCppFacade as whispercpp, withRun, zodSchema };
|
9547
|
+
export { AbortError, AbstractOpenAIChatModel, type AbstractOpenAIChatSettings, AbstractOpenAICompletionModel, type AbstractOpenAICompletionModelSettings, AbstractOpenAITextEmbeddingModel, type AbstractOpenAITextEmbeddingModelSettings, AlpacaPromptTemplate as AlpacaPrompt, ApiCallError, type ApiConfiguration, type AssistantContent, AsyncQueue, type AudioMimeType, Automatic1111ApiConfiguration, type Automatic1111ErrorData, Automatic1111ImageGenerationModel, type Automatic1111ImageGenerationPrompt, type Automatic1111ImageGenerationResponse, type Automatic1111ImageGenerationSettings, AzureOpenAIApiConfiguration, type AzureOpenAIApiConfigurationOptions, type BaseFunctionEvent, type BaseFunctionFinishedEvent, type BaseFunctionFinishedEventResult, type BaseFunctionStartedEvent, type BaseModelCallFinishedEvent, type BaseModelCallFinishedEventResult, type BaseModelCallStartedEvent, BaseUrlApiConfiguration, BaseUrlApiConfigurationWithDefaults, type BaseUrlPartsApiConfigurationOptions, type BasicTokenizer, COHERE_TEXT_EMBEDDING_MODELS, COHERE_TEXT_GENERATION_MODELS, type Cache, ChatMLPromptTemplate as ChatMLPrompt, ChatMessage, type ChatPrompt, type Classifier, type ClassifierSettings, type ClassifyFinishedEvent, type ClassifyFinishedEventResult, type ClassifyStartedEvent, CohereApiConfiguration, type CohereDetokenizationResponse, type CohereErrorData, CohereTextEmbeddingModel, type CohereTextEmbeddingModelSettings, type CohereTextEmbeddingModelType, type CohereTextEmbeddingResponse, CohereTextGenerationModel, type CohereTextGenerationModelSettings, type CohereTextGenerationModelType, type CohereTextGenerationResponse, CohereTextGenerationResponseFormat, type CohereTextGenerationResponseFormatType, type CohereTextStreamChunk, type CohereTokenizationResponse, CohereTokenizer, type CohereTokenizerModelType, type CohereTokenizerSettings, type CustomHeaderProvider, type DataContent, DefaultRun, type Delta, ElevenLabsApiConfiguration, ElevenLabsSpeechModel, type ElevenLabsSpeechModelSettings, type EmbeddingFinishedEvent, type EmbeddingFinishedEventResult, type EmbeddingModel, type EmbeddingModelSettings, EmbeddingSimilarityClassifier, type EmbeddingSimilarityClassifierSettings, type EmbeddingStartedEvent, type ExecuteFunctionFinishedEvent, type ExecuteFunctionStartedEvent, type ExecuteToolFinishedEvent, type ExecuteToolMetadata, type ExecuteToolStartedEvent, FireworksAIApiConfiguration, type FlexibleObjectFromTextPromptTemplate, type FullTokenizer, type FunctionCallOptions, type FunctionEvent, FunctionEventSource, type FunctionObserver, type FunctionOptions, type HasContextWindowSize, type HasTokenizer, type HeaderParameters, HeliconeOpenAIApiConfiguration, HuggingFaceApiConfiguration, type HuggingFaceErrorData, HuggingFaceTextEmbeddingModel, type HuggingFaceTextEmbeddingModelSettings, type HuggingFaceTextEmbeddingResponse, HuggingFaceTextGenerationModel, type HuggingFaceTextGenerationModelSettings, type HuggingFaceTextGenerationResponse, type ImageGenerationFinishedEvent, type ImageGenerationFinishedEventResult, type ImageGenerationModel, type ImageGenerationModelSettings, type ImageGenerationStartedEvent, type ImagePart, type InstructionContent, type InstructionPrompt, InvalidPromptError, JSONParseError, type JsonSchemaProducer, Llama2PromptTemplate as Llama2Prompt, LlamaCppApiConfiguration, LlamaCppCompletionModel, type LlamaCppCompletionModelSettings, type LlamaCppCompletionPrompt, LlamaCppCompletionResponseFormat, type LlamaCppCompletionResponseFormatType, type LlamaCppErrorData, LlamaCppTextEmbeddingModel, type LlamaCppTextEmbeddingModelSettings, type LlamaCppTextEmbeddingResponse, type LlamaCppTextGenerationResponse, type LlamaCppTextStreamChunk, type LlamaCppTokenizationResponse, LlamaCppTokenizer, LmntApiConfiguration, LmntSpeechModel, type LmntSpeechModelSettings, type LmntSpeechResponse, type LogFormat, MemoryCache, MemoryVectorIndex, MistralApiConfiguration, type MistralChatMessage, MistralChatModel, type MistralChatModelSettings, type MistralChatPrompt, type MistralChatResponse, MistralChatResponseFormat, type MistralChatResponseFormatType, type MistralChatStreamChunk, type MistralErrorData, MistralInstructPromptTemplate as MistralInstructPrompt, MistralTextEmbeddingModel, type MistralTextEmbeddingModelSettings, type MistralTextEmbeddingResponse, type Model, type ModelCallFinishedEvent, type ModelCallMetadata, type ModelCallStartedEvent, type ModelInformation, type ModelSettings, NeuralChatPromptTemplate as NeuralChatPrompt, NoSuchToolDefinitionError, OPENAI_CHAT_MESSAGE_BASE_TOKEN_COUNT, OPENAI_CHAT_MODELS, OPENAI_CHAT_PROMPT_BASE_TOKEN_COUNT, OPENAI_IMAGE_MODELS, OPENAI_SPEECH_MODELS, OPENAI_TEXT_EMBEDDING_MODELS, OPENAI_TEXT_GENERATION_MODELS, OPENAI_TRANSCRIPTION_MODELS, ObjectFromTextGenerationModel, type ObjectFromTextPromptTemplate, ObjectFromTextStreamingModel, type ObjectGenerationFinishedEvent, type ObjectGenerationFinishedEventResult, type ObjectGenerationModel, type ObjectGenerationModelSettings, type ObjectGenerationStartedEvent, ObjectGeneratorTool, ObjectParseError, type ObjectStream, ObjectStreamFromResponse, ObjectStreamResponse, type ObjectStreamingFinishedEvent, type ObjectStreamingModel, type ObjectStreamingStartedEvent, ObjectValidationError, OllamaApiConfiguration, type OllamaChatMessage, OllamaChatModel, type OllamaChatModelSettings, type OllamaChatPrompt, type OllamaChatResponse, OllamaChatResponseFormat, type OllamaChatResponseFormatType, type OllamaChatStreamChunk, OllamaCompletionModel, type OllamaCompletionModelSettings, type OllamaCompletionPrompt$1 as OllamaCompletionPrompt, type OllamaCompletionResponse, OllamaCompletionResponseFormat, type OllamaCompletionResponseFormatType, type OllamaCompletionStreamChunk, type OllamaErrorData, OllamaTextEmbeddingModel, type OllamaTextEmbeddingModelSettings, type OllamaTextEmbeddingResponse, type OllamaTextGenerationSettings, OpenAIApiConfiguration, type OpenAIChatBaseModelType, type OpenAIChatChunk, OpenAIChatMessage, OpenAIChatModel, type OpenAIChatModelType, type OpenAIChatPrompt, type OpenAIChatResponse, OpenAIChatResponseFormat, type OpenAIChatResponseFormatType, type OpenAIChatSettings, type OpenAICompatibleApiConfiguration, OpenAICompatibleChatModel, type OpenAICompatibleChatSettings, OpenAICompatibleCompletionModel, type OpenAICompatibleCompletionModelSettings, type OpenAICompatibleProviderName, OpenAICompatibleTextEmbeddingModel, type OpenAICompatibleTextEmbeddingModelSettings, OpenAICompletionModel, type OpenAICompletionModelSettings, type OpenAICompletionModelType, type OpenAICompletionResponse, type OpenAIErrorData, type OpenAIImageGenerationBase64JsonResponse, type OpenAIImageGenerationCallSettings, OpenAIImageGenerationModel, OpenAIImageGenerationResponseFormat, type OpenAIImageGenerationResponseFormatType, type OpenAIImageGenerationSettings, type OpenAIImageGenerationUrlResponse, type OpenAIImageModelType, OpenAISpeechModel, type OpenAISpeechModelSettings, type OpenAISpeechModelType, type OpenAISpeechVoice, OpenAITextEmbeddingModel, type OpenAITextEmbeddingModelSettings, type OpenAITextEmbeddingModelType, type OpenAITextEmbeddingResponse, OpenAITextResponseFormat, type OpenAITextResponseFormatType, type OpenAITranscriptionJsonResponse, OpenAITranscriptionModel, type OpenAITranscriptionModelSettings, type OpenAITranscriptionModelType, OpenAITranscriptionResponseFormat, type OpenAITranscriptionResponseFormatType, type OpenAITranscriptionVerboseJsonResponse, type PartialBaseUrlPartsApiConfigurationOptions, PerplexityApiConfiguration, type PromptFunction, type PromptTemplate, PromptTemplateFullTextModel, PromptTemplateImageGenerationModel, PromptTemplateTextGenerationModel, PromptTemplateTextStreamingModel, type Retriever, RetryError, type RetryErrorReason, type RetryFunction, type Run, type Schema, type SpeechGenerationFinishedEvent, type SpeechGenerationFinishedEventResult, type SpeechGenerationModel, type SpeechGenerationModelSettings, type SpeechGenerationStartedEvent, type SpeechStreamingFinishedEvent, type SpeechStreamingStartedEvent, type SplitFunction, StabilityApiConfiguration, type StabilityClipGuidancePreset, type StabilityErrorData, StabilityImageGenerationModel, type StabilityImageGenerationModelType, type StabilityImageGenerationPrompt, type StabilityImageGenerationResponse, type StabilityImageGenerationSampler, type StabilityImageGenerationSettings, type StabilityImageGenerationStylePreset, type StreamingSpeechGenerationModel, SynthiaPromptTemplate as SynthiaPrompt, type TextChunk, type TextGenerationBaseModel, type TextGenerationFinishReason, type TextGenerationFinishedEvent, type TextGenerationFinishedEventResult, type TextGenerationModel, type TextGenerationModelSettings, type TextGenerationPromptTemplate, type TextGenerationPromptTemplateProvider, type TextGenerationResult, type TextGenerationStartedEvent, TextGenerationToolCallModel, TextGenerationToolCallsModel, type TextPart, TextPromptTemplate as TextPrompt, type TextStreamingBaseModel, type TextStreamingFinishedEvent, type TextStreamingModel, type TextStreamingStartedEvent, type ThrottleFunction, TikTokenTokenizer, type TikTokenTokenizerSettings, TogetherAIApiConfiguration, Tool, type ToolCall, ToolCallArgumentsValidationError, ToolCallError, ToolCallGenerationError, type ToolCallGenerationFinishedEvent, type ToolCallGenerationFinishedEventResult, type ToolCallGenerationModel, type ToolCallGenerationModelSettings, type ToolCallGenerationStartedEvent, ToolCallParseError, type ToolCallPart, type ToolCallPromptTemplate, type ToolCallResult, type ToolCallsGenerationFinishedEvent, type ToolCallsGenerationFinishedEventResult, type ToolCallsGenerationModel, type ToolCallsGenerationModelSettings, type ToolCallsGenerationStartedEvent, ToolCallsParseError, type ToolCallsPromptTemplate, type ToolContent, type ToolDefinition, ToolExecutionError, type ToolResponsePart, type TranscriptionFinishedEvent, type TranscriptionFinishedEventResult, type TranscriptionModel, type TranscriptionModelSettings, type TranscriptionStartedEvent, TypeValidationError, UncheckedSchema, type UpsertIntoVectorIndexFinishedEvent, type UpsertIntoVectorIndexStartedEvent, type UrlParts, type UserContent, type ValueCluster, type Vector, type VectorIndex, VectorIndexRetriever, type VectorIndexRetrieverSettings, VicunaPromptTemplate as VicunaPrompt, WebSearchTool, type WebSearchToolInput, type WebSearchToolOutput, WhisperCppApiConfiguration, WhisperCppTranscriptionModel, type WhisperCppTranscriptionModelSettings, ZodSchema, ApiFacade as api, Automatic1111Facade as automatic1111, calculateOpenAIChatCostInMillicents, calculateOpenAICompletionCostInMillicents, calculateOpenAIEmbeddingCostInMillicents, calculateOpenAIImageGenerationCostInMillicents, calculateOpenAISpeechCostInMillicents, calculateOpenAITranscriptionCostInMillicents, classify, CohereFacade as cohere, convertDataContentToBase64String, convertDataContentToUint8Array, cosineSimilarity, countOpenAIChatMessageTokens, countOpenAIChatPromptTokens, countTokens, createChatPrompt, createEventSourceStream, createInstructionPrompt, createTextPrompt, delay, ElevenLabsFacade as elevenlabs, embed, embedMany, executeFunction, executeTool, generateImage, generateObject, generateSpeech, generateText, generateToolCall, generateToolCalls, generateTranscription, getAudioFileExtension, getOpenAIChatModelInformation, getOpenAICompletionModelInformation, getRun, HuggingFaceFacade as huggingface, isOpenAIChatModel, isOpenAICompletionModel, isOpenAIEmbeddingModel, isPromptFunction, jsonObjectPrompt, jsonToolCallPrompt, LlamaCppFacade as llamacpp, LmntFacade as lmnt, mapBasicPromptToAutomatic1111Format, mapBasicPromptToStabilityFormat, markAsPromptFunction, MistralFacade as mistral, ModelFusionConfiguration as modelfusion, OllamaFacade as ollama, OpenAIFacade as openai, OpenAICompatibleFacade as openaicompatible, parseJSON, retrieve, retryNever, retryWithExponentialBackoff, runTool, type runToolFinishedEvent, type runToolStartedEvent, runTools, type runToolsFinishedEvent, type runToolsStartedEvent, safeParseJSON, safeValidateTypes, splitAtCharacter, splitAtToken, splitOnSeparator, splitTextChunk, splitTextChunks, StabilityFacade as stability, streamObject, streamSpeech, streamText, textGenerationModelProperties, throttleMaxConcurrency, throttleOff, trimChatPrompt, uncheckedSchema, upsertIntoVectorIndex, validateContentIsString, validateTypes, WhisperCppFacade as whispercpp, withRun, zodSchema };
|