AI SDK Type Definitions
Common Types
Error
zif_peng_azoai_sdk_types=>ty_error
Field Name | Type | Description |
---|---|---|
code | ErrorCode | ErrorCode |
message | string | The message of this error. |
target | string | The location where the error happened if available. |
Error Code
Name | Type | Description |
---|---|---|
conflict | string | The requested operation conflicts with the current resource state. |
fileImportFailed | string | Import of file failed. |
forbidden | string | The operation is forbidden for the current user/api key. |
internalFailure | string | Internal error. Please retry. |
invalidPayload | string | The request data is invalid for this operation. |
itemDoesAlreadyExist | string | The item does already exist. |
jsonlValidationFailed | string | Validation of jsonl data failed. |
notFound | string | The resource is not found. |
quotaExceeded | string | Quota exceeded. |
serviceUnavailable | string | The service is currently not available. |
unexpectedEntityState | string | The operation cannot be executed in the current resource's state. |
Models
Model Get
zif_peng_azoai_sdk_types=>ty_model_get
Field Name | Type | Description |
---|---|---|
capabilities | Capabilities | Capabilities. The capabilities of a model. It defines the modes for scaling and the reserved capacity. |
created_at | integer | A timestamp when this job or item was created (in unix epochs). |
deprecation | Deprecation | Deprecation. The deprecation of a model. |
id | string | The identity of this item. |
lifecycle_status | Lifecycle Status | LifecycleStatus. The lifecycle status of a model. |
object | Type Discriminator | Defines the type of an object. |
status | State | State. The state of a job or item. |
updated_at | integer | A timestamp when this job or item was modified last (in unix epochs). |
Model List
zif_peng_azoai_sdk_types=>ty_model_list
Field Name | Type | Description |
---|---|---|
data | Model[] | Internal Table of Model |
Deployments
Deployment Create Info
zif_peng_azoai_sdk_types=>ty_deployments_create
Field Name | Type | Description |
---|---|---|
model | string | The OpenAI model identifier (model-id) to deploy. Can be a base model or a fine tune. |
scale_settings | Scale Settings | ScaleSettings. The scale settings of a deployment. It defines the modes for scaling and the reserved capacity. |
Deployment
zif_peng_azoai_sdk_types=>ty_deployments
Field Name | Type | Description |
---|---|---|
created_at | integer | A timestamp when this job or item was created (in unix epochs). |
error | Error | Error Information |
id | string | The identity of this item. |
model | string | The OpenAI model identifier (model-id) to deploy. Can be a base model or a fine tune. |
object | TypeDiscriminator | Type of the object. |
owner | string | The owner of this deployment. For Azure OpenAI only "organization-owner" is supported. |
scale_settings | Scale Settings | ScaleSettings. The scale settings of a deployment. It defines the modes for scaling and the reserved capacity. |
status | State | State. The state of a job or item. |
updated_at | integer | A timestamp when this job or item was modified last (in unix epochs). |
Deployment List
zif_peng_azoai_sdk_types=>ty_deployments_list
Field Name | Type | Description |
---|---|---|
data | Deployment[] | Internal Table of Deployment |
object | Type Discriminator | Defines the type of an object. |
Files
File
zif_peng_azoai_sdk_types=>ty_file_get
Field Name | Type | Description |
---|---|---|
bytes | integer | The size of this file when available (can be null). |
created_at | integer | A timestamp when this job or item was created (in unix epochs). |
error | Error | Error |
filename | string | The name of the file. |
id | string | The identity of this item. |
object | Type Discriminator | Defines the type of an object. |
purpose | Purpose | Purpose The intended purpose of the uploaded documents. Use "fine-tune" for fine-tuning. This allows validation of format of the uploaded file. |
statistics | File Statistics | FileStatistics A file is a document usable for training and validation. It can also be a service generated document with result details. |
status | State | State The state of a job or item. |
updated_at | integer | A timestamp when this job or item was modified last (in unix epochs). |
File Import
zif_peng_azoai_sdk_types=>ty_file_import
Field Name | Type | Description |
---|---|---|
content_url | string | The url to download the document from (can be SAS url of a blob or any other external url accessible with a GET request). |
filename | string | The name of the JSON Lines file to be uploaded. If the purpose is set to "fine-tune", each line is a JSON record with "prompt" and "completion" fields representing your training examples. |
purpose | Purpose | Purpose. The intended purpose of the uploaded documents. Use "fine-tune" for fine-tuning. |
File List
zif_peng_azoai_sdk_types=>ty_file_list
Field Name | Type | Description |
---|---|---|
data | File[] | The list of items. |
object | Type Discriminator | Defines the type of an object. |
File Upload
zif_peng_azoai_sdk_typinternal=>ty_int_file_upload
Field Name | Type | Description |
---|---|---|
prompt | string | Training Data Prompt |
completion | string | Training Data Completion. |
Fine Tunes
Fine Tune Create
zif_peng_azoai_sdk_types=>ty_finetune_create
Field Name | Type | Description |
---|---|---|
model | string | The identifier (model-id) of the base model used for this fine-tune. |
training_file | string | The file identity (file-id) that is used for training this fine tuned model. |
batch_size | integer | The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass. In general, we've found that larger batch sizes tend to work better for larger datasets. The default value as well as the maximum value for this property are specific to a base model. |
classification_betas | number[] | The classification beta values. If this is provided, we calculate F-beta scores at the specified beta values. The F-beta score is a generalization of F-1 score. This is only used for binary classification. With a beta of 1 (i.e.the F-1 score), precision and recall are given the same weight. A larger beta score puts more weight on recall and less on precision. A smaller beta score puts more weight on precision and less on recall. |
classification_n_classes | integer | The number of classes in a classification task. This parameter is required for multiclass classification. |
classification_positive_class | string | The positive class in binary classification. This parameter is needed to generate precision, recall, and F1 metrics when doing binary classification. |
compute_classification_metrics | boolean | A value indicating whether to compute classification metrics. If set, we calculate classification-specific metrics such as accuracy and F-1 score using the validation set at the end of every epoch. These metrics can be viewed in the results file. In order to compute classification metrics, you must provide a validation_file.Additionally, you must specify classification_n_classes for multiclass classification or classification_positive_class for binary classification. |
learning_rate_multiplier | number | The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pre-training multiplied by this value. Larger learning rates tend to perform better with larger batch sizes. We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results. |
n_epochs | integer | The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. |
prompt_loss_weight | number | The weight to use for loss on the prompt tokens. This controls how much the model tries to learn to generate the prompt (as compared to the completion which always has a weight of 1.0), and can add a stabilizing effect to training when completions are short. If prompts are extremely long (relative to completions), it may make sense to reduce this weight so as to avoid over-prioritizing learning the prompt. |
suffix | string | The suffix used to identify the fine-tuned model. The suffix can contain up to 40 characters (a-z, A-Z, 0-9,- and _) that will be added to your fine-tuned model name. |
validation_file | string | The file identity (file-id) that is used to evaluate the fine tuned model during training. |
Fine Tune Events
zif_peng_azoai_sdk_types=>ty_finetune_events
Field Name | Type | Description |
---|---|---|
data | Fine Tune Event[] | The list of items. |
object | Type Discriminator | Defines the type of an object. |
Fine Tune List
zif_peng_azoai_sdk_types=>ty_finetune_list
Field Name | Type | Description |
---|---|---|
data | Fine Tune Result[] | Internal table of Fine Tunes. |
object | Type Discriminator | Defines the type of an object. |
Fine Tune Result
zif_peng_azoai_sdk_types=>ty_finetune_result
Field Name | Type | Description |
---|---|---|
created_at | integer | A timestamp when this job or item was created (in unix epochs). |
error | Error | Error |
events | Fine Tune Events[] | The events that show the progress of the fine-tune run including queued, running and completed. |
fine_tuned_model | string | The identifier (model-id) of the resulting fine tuned model. This property is only populated for successfully completed fine-tune runs. Use this identifier to create a deployment for inferencing. |
hyperparams | HyperParameter | HyperParameters The hyper parameter settings used in a fine tune job. |
id | string | The identity of this item. |
model | string | The identifier (model-id) of the base model used for the fine-tune. |
object | Type Discriminator | Defines the type of an object. |
organisation_id | string | The organisation id of this fine tune job. Unused on Azure OpenAI; compatibility for OpenAI only. |
result_files | File[] | The result file identities (file-id) containing training and evaluation metrics in csv format. The file is only available for successfully completed fine-tune runs. |
status | State | State. The state of a job or item. |
suffix | string | The suffix used to identify the fine-tuned model. |
training_files | File[] | The file identities (file-id) that are used for training the fine tuned model. |
updated_at | integer | A timestamp when this job or item was modified last (in unix epochs). |
user_id | string | The user id of this fine tune job. Unused on Azure OpenAI; compatibility for OpenAI only. |
validation_files | File[] | The file identities (file-id) that are used to evaluate the fine tuned model during training. |
Embeddings
Embedding Input
zif_peng_azoai_sdk_types=>ty_embeddings_input
Field Name | Type | Description |
---|---|---|
input | string[] | Input text to get embeddings for, encoded as a string. The number of input tokens varies depending on what model you are using. |
Embedding Output
zif_peng_azoai_sdk_types=>ty_embeddings_output
Field Name | Type | Description |
---|---|---|
object | Type Discriminator | Defines the type of an object. For embedding, this will be "list" |
data | Embeddings[] | An array of embeddings, based on the number of inputs. |
model | string | The identifier of the model/deployment used to generate the embeddings. |
usage | Embedding Usage | Useage Information for this embedding run. |
Completions
Completion Input
zif_peng_azoai_sdk_types=>ty_completion_input
Field Name | Type | Description |
---|---|---|
prompt | string[] | The prompt(s) to generate completions for, encoded as a string, a list of strings, or a list of token lists. Note that <\|endoftext\|> is the document separator that the model sees during training, so if a prompt isn't specified the model will generate as if from the beginning of a new document. |
max_tokens | integer | The maximum number of tokens to generate. |
user | string | A unique identifier representing your end-user, which can help monitoring and detecting abuse. Do not pass PII identifiers instead use pseudoanonymized values such as GUIDs |
n | integer | The number of completions to generate for each prompt. |
temperature | number | What sampling temperature to use, between 0 and 2. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or top_p but not both. |
top_p | number | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. |
stop | string[] | Up to four sequences where the API will stop generating further tokens. The returned text won't contain the stop sequence. |
frequency_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. |
presence_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. |
best_of | integer | Generates best_of completions server-side and returns the "best" (the one with the lowest log probability per token). When used with n, best_of controls the number of candidate completions and n specifies how many to return from those - best_of must be greater than n |
Careful using the parameters "n" and "best_of". Because this parameter generates many completions, it can quickly consume your token quota. Use carefully and ensure that you have reasonable settings for max_tokens and stop.
Completion Output
zif_peng_azoai_sdk_types=>ty_completion_output
Field Name | Type | Description |
---|---|---|
id | string | The identity of this item. |
object | Type Discriminator | Defines the type of an object. |
created | integer | A timestamp when this job or item was created (in unix epochs). |
model | string | The identifier (model-id) of the model used for this completion. |
choices | Completion Choice[] | The completions that are generated |
usage | Completion Usage | Useage Information for this completion run. |
Completion Choice
zif_peng_azoai_sdk_typinternal=>ty_completion_resobj_choices
Field Name | Type | Description |
---|---|---|
text | string | The text of the completion. |
index | integer | The index of the prompt this completion is generated for. |
finish_reason | string | Reason for the response text to be output. |
Usage
zif_peng_azoai_sdk_typinternal=>ty_completion_resobj_usage
Field Name | Type | Description |
---|---|---|
completion_tokens | integer | The number of tokens generated by the completion/embedding. |
prompt_tokens | integer | The number of tokens used as prompt for the completion/embedding. |
total_tokens | integer | The total number of tokens (prompt + completion) generated by the completion/embedding. |
Chat Completions
Chat Completion Message
zif_peng_azoai_sdk_types=>ty_chatcompletion_message
Field Name | Type | Description |
---|---|---|
role | Role | The role of the message. |
content | string | The content of the message. |
Chat Completion Input
zif_peng_azoai_sdk_types=>ty_chatcompletion_input
The current Completion input structure has only a subset of fields, compared to all the fields supported by AI Engines. In future, we will expand this capability
Field Name | Type | Description |
---|---|---|
messages | Chat Completion Message[] | A list of messages that will be used as context to generate the completion. |
max_tokens | integer | The maximum number of tokens to generate. |
user | string | A unique identifier representing your end-user, which can help monitoring and detecting abuse. Do not pass PII identifiers instead use pseudoanonymized values such as GUIDs |
n | integer | The number of completions to generate for each prompt. |
temperature | number | What sampling temperature to use, between 0 and 2. Higher values means the model will take more risks. Try 0.9 for more creative applications, and 0 (argmax sampling) for ones with a well-defined answer. We generally recommend altering this or top_p but not both. |
top_p | number | An alternative to sampling with temperature, called nucleus sampling, where the model considers the results of the tokens with top_p probability mass. So 0.1 means only the tokens comprising the top 10% probability mass are considered. We generally recommend altering this or temperature but not both. |
stop | string[] | Up to four sequences where the API will stop generating further tokens. The returned text won't contain the stop sequence. |
frequency_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on their existing frequency in the text so far, decreasing the model's likelihood to repeat the same line verbatim. |
presence_penalty | number | Number between -2.0 and 2.0. Positive values penalize new tokens based on whether they appear in the text so far, increasing the model's likelihood to talk about new topics. |
Chat Completion Output
zif_peng_azoai_sdk_types=>ty_chatcompletion_output
Field Name | Type | Description |
---|---|---|
id | string | The identity of this item. |
object | Type Discriminator | Defines the type of an object. |
created | integer | A timestamp when this job or item was created (in unix epochs). |
model | string | The identifier (model-id) of the model used for this completion. |
choices | Chat Completion Choice[] | The completions that are generated |
usage | Completion Usage | Useage Information for this completion run. |
Chat Completion Choice
zif_peng_azoai_sdk_typinternal=>tty_chatcompl_resobj_choices
Field Name | Type | Description |
---|---|---|
index | integer | The index of the prompt this completion is generated for. |
finish_reason | string | Reason for the response text to be output. |
message | Chat Completion Message | The messages generated by the completion. |
Internal Types
The following are internal types of AI SDK, and chances are, you wont be declaring these types in your use cases or ABAP programs. However, you will still come across these as fields in other exposed data types.
Capabilities
zif_peng_azoai_sdk_typinternal=>ty_int_mod_get_capabilities
Value | Type | Description |
---|---|---|
completion | boolean | Whether the model supports completion. |
embeddings | boolean | Whether the model supports embeddings. |
fine_tune | boolean | Whether the model supports fine-tuning. |
inference | boolean | Whether the model supports inference. |
scale_types | string[] | The supported scale types. |
Deprecation
zif_peng_azoai_sdk_typinternal=>ty_int_mod_get_deprecation
Value | Type | Description |
---|---|---|
fine_tune | integer | The end date of fine tune support of this model. Will be null for fine tune models. |
inference | integer | The end date of inference support of this model. |
Embedding
zif_peng_azoai_sdk_typinternal=>ty_embedding
Field Name | Type | Description |
---|---|---|
object | Type Discriminator | Defines the type of an object. |
index | integer | The index of the input this embedding is generated for. |
embedding | float[] | The embedding vector. |
File Statistics
zif_peng_azoai_sdk_typinternal=>ty_int_file_stats
Field Name | Type | Description |
---|---|---|
examples | integer | The number of contained training examples in files of kind "fine-tune" once validation of file content is complete. |
tokens | integer | The number of tokens used in prompts and completions for files of kind "fine-tune" once validation of file content is complete. |
Finetune Event
zif_peng_azoai_sdk_typinternal=>ty_int_finetune_event
Field Name | Type | Description |
---|---|---|
created_at | integer | A timestamp when this event was created (in unix epochs). |
level | Log Level | LogLevel. The verbosity level of an event. |
message | string | The message describing the event. This can be a change of state, e.g., enqueued, started, failed or completed, or other events like uploaded results. |
object | Type Discriminator | Defines the type of an object. |
Hyper Parameters
zif_peng_azoai_sdk_typinternal=>ty_int_finetune_hyperparams
Field Name | Type | Description |
---|---|---|
batch_size | integer | The batch size to use for training. The batch size is the number of training examples used to train a single forward and backward pass. In general, we've found that larger batch sizes tend to work better for larger datasets. The default value as well as the maximum value for this property are specific to a base model. |
classification_betas | number[] | The classification beta values. If this is provided, we calculate F-beta scores at the specified beta values. The F-beta score is a generalization of F-1 score. This is only used for binary classification. With a beta of 1 (i.e.the F-1 score), precision and recall are given the same weight. A larger beta score puts more weight on recall and less on precision. A smaller beta score puts more weight on precision and less on recall. |
classification_n_classes | integer | The number of classes in a classification task. This parameter is required for multiclass classification. |
classification_positive_class | string | The positive class in binary classification. This parameter is needed to generate precision, recall, and F1 metrics when doing binary classification. |
compute_classification_metrics | boolean | A value indicating whether to compute classification metrics. If set, we calculate classification-specific metrics such as accuracy and F-1 score using the validation set at the end of every epoch. These metrics can be viewed in the results file. In order to compute classification metrics, you must provide a validation_file.Additionally, you must specify classification_n_classes for multiclass classification or classification_positive_class for binary classification. |
learning_rate_multiplier | number | The learning rate multiplier to use for training. The fine-tuning learning rate is the original learning rate used for pre-training multiplied by this value. Larger learning rates tend to perform better with larger batch sizes. We recommend experimenting with values in the range 0.02 to 0.2 to see what produces the best results. |
n_epochs | integer | The number of epochs to train the model for. An epoch refers to one full cycle through the training dataset. |
prompt_loss_weight | number | The weight to use for loss on the prompt tokens. This controls how much the model tries to learn to generate the prompt (as compared to the completion which always has a weight of 1.0), and can add a stabilizing effect to training when completions are short. If prompts are extremely long (relative to completions), it may make sense to reduce this weight so as to avoid over-prioritizing learning the prompt. |
Log Level
string
Value | Description |
---|---|
error | This message represents a non recoverable issue. |
info | This message represents an informational message. |
warning | This event represents a mitigated issue. |
Lifecycle Status
string
Value | Type | Description |
---|---|---|
generally-available | string | The model is generally available. |
preview | string | Model is in preview and covered by the service preview terms. |
Purpose
string
Value | Description |
---|---|
fine-tune | This file contains training data for a fine tune job. |
fine-tune-results | This file contains the results of a fine tune job. |
Role
string
Value | Description |
---|---|
system | System Role, also known as System message - provides initial instructions to the model. |
user | User Message. When invoking the AI Engine with Chat Completion, the last message should have the role "user". |
assistant | This role is used to for previous or current responses from AI Engine |
Scale Settings
zif_peng_azoai_sdk_typinternal=>ty_scale_settings
Field Name | Type | Description |
---|---|---|
capacity | Integer | The constant reserved capacity of the inference endpoint for this deployment. Only used when scale_type is manual |
scale_type | String
| Defines how scaling operations will be executed. If set to manual, capacity must be specified. |
State
string
Value | Description |
---|---|
canceled | The operation has been canceled and is incomplete. |
deleted | The entity has been deleted but may still be referenced by other entities predating the deletion. |
failed | The operation has completed processing with a failure and cannot be further consumed. |
notRunning | The operation was created and is not queued to be processed in the future. |
running | The operation has started to be processed. |
succeeded | The operation has successfully be processed and is ready for consumption. |
Type Discriminator
string
Value | Description |
---|---|
model | This object represents a model (can be a base models or fine tune job result). |
deployment | This object represents a deployment. |
file | This object represents a file. |
fine-tune | This object represents a fine tune job. |
fine-tune-event | This object represents an event of a fine tune job. |
list | This object represents a list of other objects. |
completion | This object represents a completion. |
chat.completion | This object represents a chat completion. |