Interface: ObjectStreamingModel<PROMPT, SETTINGS>
Type parameters
Name | Type |
---|---|
PROMPT | PROMPT |
SETTINGS | extends ObjectGenerationModelSettings = ObjectGenerationModelSettings |
Hierarchy
-
ObjectGenerationModel
<PROMPT
,SETTINGS
>↳
ObjectStreamingModel
Implemented by
Accessors
settingsForEvent
• get
settingsForEvent(): Partial
<SETTINGS
>
Returns settings that should be recorded in observability events. Security-related settings (e.g. API keys) should not be included here.
Returns
Partial
<SETTINGS
>
Inherited from
ObjectGenerationModel.settingsForEvent
Defined in
packages/modelfusion/src/model-function/Model.ts:19
Methods
doGenerateObject
▸ doGenerateObject(schema
, prompt
, options?
): PromiseLike
<{ rawResponse
: unknown
; usage?
: { completionTokens
: number
; promptTokens
: number
; totalTokens
: number
} ; value
: unknown
; valueText
: string
}>
Parameters
Name | Type |
---|---|
schema | Schema <unknown > & JsonSchemaProducer |
prompt | PROMPT |
options? | FunctionOptions |
Returns
PromiseLike
<{ rawResponse
: unknown
; usage?
: { completionTokens
: number
; promptTokens
: number
; totalTokens
: number
} ; value
: unknown
; valueText
: string
}>
Inherited from
ObjectGenerationModel.doGenerateObject
Defined in
packages/modelfusion/src/model-function/generate-object/ObjectGenerationModel.ts:14
doStreamObject
▸ doStreamObject(schema
, prompt
, options?
): PromiseLike
<AsyncIterable
<Delta
<unknown
>>>
Parameters
Name | Type |
---|---|
schema | Schema <unknown > & JsonSchemaProducer |
prompt | PROMPT |
options? | FunctionOptions |
Returns
PromiseLike
<AsyncIterable
<Delta
<unknown
>>>
Defined in
packages/modelfusion/src/model-function/generate-object/ObjectGenerationModel.ts:35
extractObjectTextDelta
▸ extractObjectTextDelta(delta
): undefined
| string
Parameters
Name | Type |
---|---|
delta | unknown |
Returns
undefined
| string
Defined in
packages/modelfusion/src/model-function/generate-object/ObjectGenerationModel.ts:41
parseAccumulatedObjectText
▸ parseAccumulatedObjectText(accumulatedText
): unknown
Parameters
Name | Type |
---|---|
accumulatedText | string |
Returns
unknown
Defined in
packages/modelfusion/src/model-function/generate-object/ObjectGenerationModel.ts:43
withSettings
▸ withSettings(additionalSettings
): this
The withSettings
method creates a new model with the same configuration as the original model, but with the specified settings changed.
Parameters
Name | Type |
---|---|
additionalSettings | Partial <SETTINGS > |
Returns
this
Example
const model = new OpenAICompletionModel({
model: "gpt-3.5-turbo-instruct",
maxGenerationTokens: 500,
});
const modelWithMoreTokens = model.withSettings({
maxGenerationTokens: 1000,
});
Inherited from
ObjectGenerationModel.withSettings
Defined in
packages/modelfusion/src/model-function/Model.ts:34
Properties
modelInformation
• modelInformation: ModelInformation
Inherited from
ObjectGenerationModel.modelInformation
Defined in
packages/modelfusion/src/model-function/Model.ts:12
settings
• Readonly
settings: SETTINGS
Inherited from
ObjectGenerationModel.settings