Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: update services #177

Merged
merged 1 commit into from
Dec 9, 2024
Merged
Show file tree
Hide file tree
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
5 changes: 5 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ dist

# generate_services start
/ai-assistants-v1
/ai-dataset-v1
/ai-files-v1
/ai-foundation_models-v1
/ai-llm-v1alpha
Expand All @@ -12,6 +13,7 @@ dist
/ai-stt-v3
/ai-translate-v2
/ai-tts-v3
/ai-tuning-v1
/ai-vision-v1
/ai-vision-v2
/airflow-v1
Expand All @@ -23,6 +25,7 @@ dist
/certificatemanager-v1
/cic-v1
/cloudapps-workload-v1
/cloudregistry-v1
/cloudrouter-v1
/compute-v1
/containerregistry-v1
Expand All @@ -47,6 +50,7 @@ dist
/marketplace-licensemanager-saas-v1
/marketplace-licensemanager-v1
/marketplace-metering-v1
/marketplace-pim-v1
/marketplace-v1
/mdb-clickhouse-v1
/mdb-elasticsearch-v1
Expand All @@ -63,6 +67,7 @@ dist
/operation
/organizationmanager-v1
/resourcemanager-v1
/searchapi-v2
/serverless-apigateway-v1
/serverless-apigateway-websocket-v1
/serverless-containers-v1
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,46 @@ import { Timestamp } from '../../../../../google/protobuf/timestamp';

export const protobufPackage = 'yandex.cloud.ai.assistants.v1';

/** Assistant represents an AI assistant configuration with various settings and metadata. */
export interface Assistant {
$type: 'yandex.cloud.ai.assistants.v1.Assistant';
/** Unique identifier of the assistant. */
id: string;
/** ID of the folder that the assistant belongs to. */
folderId: string;
/** Name of the assistant. */
name: string;
/** Description of the assistant. */
description: string;
/** Identifier of the subject who created this assistant. */
createdBy: string;
/** Timestamp representing when the assistant was created. */
createdAt?: Date;
/** Identifier of the subject who last updated this assistant. */
updatedBy: string;
/** Timestamp representing the last time this assistant was updated. */
updatedAt?: Date;
/** Configuration for the expiration of the assistant, defining when and how the assistant will expire. */
expirationConfig?: ExpirationConfig;
/** Timestamp representing when the assistant will expire. */
expiresAt?: Date;
/** Set of key-value pairs that can be used to organize and categorize the assistant. */
labels: { [key: string]: string };
/** The [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for completion generation. */
modelUri: string;
/**
* Instructions or guidelines that the assistant should follow when generating responses or performing tasks.
* These instructions can help guide the assistant's behavior and responses.
*/
instruction: string;
/** Configuration options for truncating the prompt when the token count exceeds a specified limit. */
promptTruncationOptions?: PromptTruncationOptions;
/** Configuration options for completion generation. */
completionOptions?: CompletionOptions;
/**
* List of tools that the assistant can use to perform additional tasks.
* One example is the SearchIndexTool, which is used for Retrieval-Augmented Generation (RAG).
*/
tools: Tool[];
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,17 +25,33 @@ import { Assistant } from '../../../../../yandex/cloud/ai/assistants/v1/assistan

export const protobufPackage = 'yandex.cloud.ai.assistants.v1';

/** Request to create a new assistant. */
export interface CreateAssistantRequest {
$type: 'yandex.cloud.ai.assistants.v1.CreateAssistantRequest';
folderId: string;
/** Name of the assistant. */
name: string;
/** Description of the assistant. */
description: string;
/** Expiration configuration for the assistant. */
expirationConfig?: ExpirationConfig;
/** Set of key-value pairs to label the user. */
labels: { [key: string]: string };
/** The [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for completion generation. */
modelUri: string;
/**
* Instructions or guidelines that the assistant should follow when generating responses or performing tasks.
* These instructions can help guide the assistant's behavior and responses.
*/
instruction: string;
/** Configuration options for truncating the prompt when the token count exceeds a specified limit. */
promptTruncationOptions?: PromptTruncationOptions;
/** Configuration options for completion generation. */
completionOptions?: CompletionOptions;
/**
* List of tools that the assistant can use to perform additional tasks.
* One example is the SearchIndexTool, which is used for Retrieval-Augmented Generation (RAG).
*/
tools: Tool[];
}

Expand All @@ -45,23 +61,37 @@ export interface CreateAssistantRequest_LabelsEntry {
value: string;
}

/** Request message for retrieving an assistant by ID. */
export interface GetAssistantRequest {
$type: 'yandex.cloud.ai.assistants.v1.GetAssistantRequest';
/** ID of the assistant to retrieve. */
assistantId: string;
}

/** Request message for updating an existing assistant. */
export interface UpdateAssistantRequest {
$type: 'yandex.cloud.ai.assistants.v1.UpdateAssistantRequest';
/** ID of the assistant to update. */
assistantId: string;
/** Field mask specifying which fields to update. */
updateMask?: FieldMask;
/** New name for the assistant. */
name: string;
/** New description for the assistant. */
description: string;
/** New expiration configuration for the assistant. */
expirationConfig?: ExpirationConfig;
/** New set of labels for the assistant. */
labels: { [key: string]: string };
/** The new [ID of the model](/docs/foundation-models/concepts/yandexgpt/models) to be used for completion generation. */
modelUri: string;
/** New instructions or guidelines for the assistant to follow. */
instruction: string;
/** New configuration for truncating the prompt. */
promptTruncationOptions?: PromptTruncationOptions;
/** New configuration for completion generation. */
completionOptions?: CompletionOptions;
/** New list of tools the assistant can use. */
tools: Tool[];
}

Expand All @@ -71,45 +101,66 @@ export interface UpdateAssistantRequest_LabelsEntry {
value: string;
}

/** Request message for deleting an assistant by ID. */
export interface DeleteAssistantRequest {
$type: 'yandex.cloud.ai.assistants.v1.DeleteAssistantRequest';
/** ID of the assistant to delete. */
assistantId: string;
}

/** Response message for the delete operation. */
export interface DeleteAssistantResponse {
$type: 'yandex.cloud.ai.assistants.v1.DeleteAssistantResponse';
}

/** Request message for listing assistants in a specific folder. */
export interface ListAssistantsRequest {
$type: 'yandex.cloud.ai.assistants.v1.ListAssistantsRequest';
/** Folder ID from which to list assistants. */
folderId: string;
/** Maximum number of assistants to return per page. */
pageSize: number;
/** Token to retrieve the next page of results. */
pageToken: string;
}

/** Response message for the list operation. */
export interface ListAssistantsResponse {
$type: 'yandex.cloud.ai.assistants.v1.ListAssistantsResponse';
/** List of assistants in the specified folder. */
assistants: Assistant[];
/** Token to retrieve the next page of results. */
nextPageToken: string;
}

/** Request to list all versions of a specific assistant. */
export interface ListAssistantVersionsRequest {
$type: 'yandex.cloud.ai.assistants.v1.ListAssistantVersionsRequest';
/** ID of the assistant whose versions are to be listed. */
assistantId: string;
/** Maximum number of versions to return per page. */
pageSize: number;
/** Token to retrieve the next page of results. */
pageToken: string;
}

/** Represents a specific version of an assistant. */
export interface AssistantVersion {
$type: 'yandex.cloud.ai.assistants.v1.AssistantVersion';
/** ID of the assistant version. */
id: string;
/** Mask specifying which fields were updated in this version. */
updateMask?: FieldMask;
/** Assistant configuration for this version. */
assistant?: Assistant;
}

/** Response message containing the list versions operation. */
export interface ListAssistantVersionsResponse {
$type: 'yandex.cloud.ai.assistants.v1.ListAssistantVersionsResponse';
/** List of assistant versions. */
versions: AssistantVersion[];
/** Token to retrieve the next page of results. */
nextPageToken: string;
}

Expand Down Expand Up @@ -1309,7 +1360,9 @@ export const ListAssistantVersionsResponse = {

messageTypeRegistry.set(ListAssistantVersionsResponse.$type, ListAssistantVersionsResponse);

/** AssistantService provides operations for managing assistants. */
export const AssistantServiceService = {
/** Create a new assistant. */
create: {
path: '/yandex.cloud.ai.assistants.v1.AssistantService/Create',
requestStream: false,
Expand All @@ -1320,6 +1373,7 @@ export const AssistantServiceService = {
responseSerialize: (value: Assistant) => Buffer.from(Assistant.encode(value).finish()),
responseDeserialize: (value: Buffer) => Assistant.decode(value),
},
/** Retrieve details of a specific assistant by its ID. */
get: {
path: '/yandex.cloud.ai.assistants.v1.AssistantService/Get',
requestStream: false,
Expand All @@ -1330,6 +1384,7 @@ export const AssistantServiceService = {
responseSerialize: (value: Assistant) => Buffer.from(Assistant.encode(value).finish()),
responseDeserialize: (value: Buffer) => Assistant.decode(value),
},
/** Update an existing assistant. */
update: {
path: '/yandex.cloud.ai.assistants.v1.AssistantService/Update',
requestStream: false,
Expand All @@ -1340,6 +1395,7 @@ export const AssistantServiceService = {
responseSerialize: (value: Assistant) => Buffer.from(Assistant.encode(value).finish()),
responseDeserialize: (value: Buffer) => Assistant.decode(value),
},
/** Delete an assistant by its ID. */
delete: {
path: '/yandex.cloud.ai.assistants.v1.AssistantService/Delete',
requestStream: false,
Expand All @@ -1351,6 +1407,7 @@ export const AssistantServiceService = {
Buffer.from(DeleteAssistantResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => DeleteAssistantResponse.decode(value),
},
/** List assistants in a specific folder. */
list: {
path: '/yandex.cloud.ai.assistants.v1.AssistantService/List',
requestStream: false,
Expand All @@ -1362,6 +1419,7 @@ export const AssistantServiceService = {
Buffer.from(ListAssistantsResponse.encode(value).finish()),
responseDeserialize: (value: Buffer) => ListAssistantsResponse.decode(value),
},
/** Lists all versions of a specific assistant. */
listVersions: {
path: '/yandex.cloud.ai.assistants.v1.AssistantService/ListVersions',
requestStream: false,
Expand All @@ -1376,15 +1434,22 @@ export const AssistantServiceService = {
} as const;

export interface AssistantServiceServer extends UntypedServiceImplementation {
/** Create a new assistant. */
create: handleUnaryCall<CreateAssistantRequest, Assistant>;
/** Retrieve details of a specific assistant by its ID. */
get: handleUnaryCall<GetAssistantRequest, Assistant>;
/** Update an existing assistant. */
update: handleUnaryCall<UpdateAssistantRequest, Assistant>;
/** Delete an assistant by its ID. */
delete: handleUnaryCall<DeleteAssistantRequest, DeleteAssistantResponse>;
/** List assistants in a specific folder. */
list: handleUnaryCall<ListAssistantsRequest, ListAssistantsResponse>;
/** Lists all versions of a specific assistant. */
listVersions: handleUnaryCall<ListAssistantVersionsRequest, ListAssistantVersionsResponse>;
}

export interface AssistantServiceClient extends Client {
/** Create a new assistant. */
create(
request: CreateAssistantRequest,
callback: (error: ServiceError | null, response: Assistant) => void,
Expand All @@ -1400,6 +1465,7 @@ export interface AssistantServiceClient extends Client {
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Assistant) => void,
): ClientUnaryCall;
/** Retrieve details of a specific assistant by its ID. */
get(
request: GetAssistantRequest,
callback: (error: ServiceError | null, response: Assistant) => void,
Expand All @@ -1415,6 +1481,7 @@ export interface AssistantServiceClient extends Client {
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Assistant) => void,
): ClientUnaryCall;
/** Update an existing assistant. */
update(
request: UpdateAssistantRequest,
callback: (error: ServiceError | null, response: Assistant) => void,
Expand All @@ -1430,6 +1497,7 @@ export interface AssistantServiceClient extends Client {
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: Assistant) => void,
): ClientUnaryCall;
/** Delete an assistant by its ID. */
delete(
request: DeleteAssistantRequest,
callback: (error: ServiceError | null, response: DeleteAssistantResponse) => void,
Expand All @@ -1445,6 +1513,7 @@ export interface AssistantServiceClient extends Client {
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: DeleteAssistantResponse) => void,
): ClientUnaryCall;
/** List assistants in a specific folder. */
list(
request: ListAssistantsRequest,
callback: (error: ServiceError | null, response: ListAssistantsResponse) => void,
Expand All @@ -1460,6 +1529,7 @@ export interface AssistantServiceClient extends Client {
options: Partial<CallOptions>,
callback: (error: ServiceError | null, response: ListAssistantsResponse) => void,
): ClientUnaryCall;
/** Lists all versions of a specific assistant. */
listVersions(
request: ListAssistantVersionsRequest,
callback: (error: ServiceError | null, response: ListAssistantVersionsResponse) => void,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,50 @@ import { Int64Value, DoubleValue } from '../../../../../google/protobuf/wrappers

export const protobufPackage = 'yandex.cloud.ai.assistants.v1';

/** Defines the options for truncating thread messages within a prompt. */
export interface PromptTruncationOptions {
$type: 'yandex.cloud.ai.assistants.v1.PromptTruncationOptions';
/**
* The maximum number of tokens allowed in the prompt.
* If the prompt exceeds this limit, the thread messages will be truncated.
* Default max_prompt_tokens: 7000
*/
maxPromptTokens?: number;
}

/** Defines the options for completion generation. */
export interface CompletionOptions {
$type: 'yandex.cloud.ai.assistants.v1.CompletionOptions';
/**
* The limit on the number of tokens used for single completion generation.
* Must be greater than zero. This maximum allowed parameter value may depend on the model being used.
*/
maxTokens?: number;
/**
* Affects creativity and randomness of responses. Should be a double number between 0 (inclusive) and 1 (inclusive).
* Lower values produce more straightforward responses while higher values lead to increased creativity and randomness.
* Default temperature: 0.3
*/
temperature?: number;
}

/** Configures a tool that enables Retrieval-Augmented Generation (RAG) by allowing the assistant to search across a specified search index. */
export interface SearchIndexTool {
$type: 'yandex.cloud.ai.assistants.v1.SearchIndexTool';
/** A list of search index IDs that this tool will query. Currently, only a single index ID is supported. */
searchIndexIds: string[];
/**
* The maximum number of results to return from the search.
* Fewer results may be returned if necessary to fit within the prompt's token limit.
* This ensures that the combined prompt and search results do not exceed the token constraints.
*/
maxNumResults?: number;
}

/** Represents a general tool that can be one of several types. */
export interface Tool {
$type: 'yandex.cloud.ai.assistants.v1.Tool';
/** SearchIndexTool tool that performs search across specified indexes. */
searchIndex?: SearchIndexTool | undefined;
}

Expand Down
Loading
Loading