Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 152 additions & 0 deletions src/interactions/resources/interactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1283,6 +1283,17 @@ export interface Interaction {
| DocumentContent
| VideoContent;

/**
* Optional. The labels with user-defined metadata for the request. It is used for
* billing and reporting only.
*
* Label keys and values can be no longer than 63 characters (Unicode codepoints)
* and can only contain lowercase letters, numeric characters, underscores, and
* dashes. International characters are allowed. Label values are optional. Label
* keys must start with a letter.
*/
labels?: { [key: string]: string };

/**
* The name of the `Model` used for generating the interaction.
*/
Expand Down Expand Up @@ -1320,6 +1331,11 @@ export interface Interaction {
*/
role?: string;

/**
* Safety settings for the interaction.
*/
safety_settings?: Array<Interaction.SafetySetting>;

/**
* The service tier for the interaction.
*/
Expand Down Expand Up @@ -1540,6 +1556,40 @@ export namespace Interaction {
path?: string;
}
}

/**
* A safety setting that affects the safety-blocking behavior.
*
* A SafetySetting consists of a harm category and a threshold for that category.
*/
export interface SafetySetting {
/**
* Required. The harm category to be blocked.
*/
category:
| 'hate_speech'
| 'dangerous_content'
| 'harassment'
| 'sexually_explicit'
| 'civic_integrity'
| 'image_hate'
| 'image_dangerous_content'
| 'image_harassment'
| 'image_sexually_explicit'
| 'jailbreak';

/**
* Required. The threshold for blocking content. If the harm probability exceeds
* this threshold, the content will be blocked.
*/
threshold: 'block_low_and_above' | 'block_medium_and_above' | 'block_only_high' | 'block_none' | 'off';

/**
* Optional. The method for blocking content. If not specified, the default
* behavior is to use the probability score.
*/
method?: 'severity' | 'probability';
}
}

export interface InteractionCompletedEvent {
Expand Down Expand Up @@ -3045,6 +3095,17 @@ export interface BaseCreateModelInteractionParams {
*/
generation_config?: GenerationConfig;

/**
* Body param: Optional. The labels with user-defined metadata for the request. It
* is used for billing and reporting only.
*
* Label keys and values can be no longer than 63 characters (Unicode codepoints)
* and can only contain lowercase letters, numeric characters, underscores, and
* dashes. International characters are allowed. Label values are optional. Label
* keys must start with a letter.
*/
labels?: { [key: string]: string };

/**
* Body param: The ID of the previous interaction, if any.
*/
Expand Down Expand Up @@ -3072,6 +3133,11 @@ export interface BaseCreateModelInteractionParams {
*/
response_modalities?: Array<'text' | 'image' | 'audio' | 'video' | 'document'>;

/**
* Body param: Safety settings for the interaction.
*/
safety_settings?: Array<BaseCreateModelInteractionParams.SafetySetting>;

/**
* Body param: The service tier for the interaction.
*/
Expand Down Expand Up @@ -3105,6 +3171,42 @@ export interface BaseCreateModelInteractionParams {
webhook_config?: WebhookConfig;
}

export namespace BaseCreateModelInteractionParams {
/**
* A safety setting that affects the safety-blocking behavior.
*
* A SafetySetting consists of a harm category and a threshold for that category.
*/
export interface SafetySetting {
/**
* Required. The harm category to be blocked.
*/
category:
| 'hate_speech'
| 'dangerous_content'
| 'harassment'
| 'sexually_explicit'
| 'civic_integrity'
| 'image_hate'
| 'image_dangerous_content'
| 'image_harassment'
| 'image_sexually_explicit'
| 'jailbreak';

/**
* Required. The threshold for blocking content. If the harm probability exceeds
* this threshold, the content will be blocked.
*/
threshold: 'block_low_and_above' | 'block_medium_and_above' | 'block_only_high' | 'block_none' | 'off';

/**
* Optional. The method for blocking content. If not specified, the default
* behavior is to use the probability score.
*/
method?: 'severity' | 'probability';
}
}

export interface BaseCreateAgentInteractionParams {
/**
* Path param: Which version of the API to use.
Expand Down Expand Up @@ -3155,6 +3257,17 @@ export interface BaseCreateAgentInteractionParams {
*/
environment?: Environment | string;

/**
* Body param: Optional. The labels with user-defined metadata for the request. It
* is used for billing and reporting only.
*
* Label keys and values can be no longer than 63 characters (Unicode codepoints)
* and can only contain lowercase letters, numeric characters, underscores, and
* dashes. International characters are allowed. Label values are optional. Label
* keys must start with a letter.
*/
labels?: { [key: string]: string };

/**
* Body param: The ID of the previous interaction, if any.
*/
Expand Down Expand Up @@ -3182,6 +3295,11 @@ export interface BaseCreateAgentInteractionParams {
*/
response_modalities?: Array<'text' | 'image' | 'audio' | 'video' | 'document'>;

/**
* Body param: Safety settings for the interaction.
*/
safety_settings?: Array<BaseCreateAgentInteractionParams.SafetySetting>;

/**
* Body param: The service tier for the interaction.
*/
Expand Down Expand Up @@ -3380,6 +3498,40 @@ export namespace BaseCreateAgentInteractionParams {
path?: string;
}
}

/**
* A safety setting that affects the safety-blocking behavior.
*
* A SafetySetting consists of a harm category and a threshold for that category.
*/
export interface SafetySetting {
/**
* Required. The harm category to be blocked.
*/
category:
| 'hate_speech'
| 'dangerous_content'
| 'harassment'
| 'sexually_explicit'
| 'civic_integrity'
| 'image_hate'
| 'image_dangerous_content'
| 'image_harassment'
| 'image_sexually_explicit'
| 'jailbreak';

/**
* Required. The threshold for blocking content. If the harm probability exceeds
* this threshold, the content will be blocked.
*/
threshold: 'block_low_and_above' | 'block_medium_and_above' | 'block_only_high' | 'block_none' | 'off';

/**
* Optional. The method for blocking content. If not specified, the default
* behavior is to use the probability score.
*/
method?: 'severity' | 'probability';
}
}

export interface CreateModelInteractionParamsNonStreaming extends BaseCreateModelInteractionParams {
Expand Down
Loading