Skip to content
Open
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
10 changes: 10 additions & 0 deletions src/genai/converters/_sessions_converters.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,11 @@ export function createAgentEngineSessionConfigToVertex(
common.setValueByPath(parentObject, ['labels'], fromLabels);
}

const fromSessionId = common.getValueByPath(fromObject, ['sessionId']);
if (parentObject !== undefined && fromSessionId != null) {
common.setValueByPath(parentObject, ['_query', 'sessionId'], fromSessionId);
}

return toObject;
}

Expand Down Expand Up @@ -185,6 +190,11 @@ export function updateAgentEngineSessionConfigToVertex(
common.setValueByPath(parentObject, ['labels'], fromLabels);
}

const fromSessionId = common.getValueByPath(fromObject, ['sessionId']);
if (parentObject !== undefined && fromSessionId != null) {
common.setValueByPath(parentObject, ['_query', 'sessionId'], fromSessionId);
}

const fromUpdateMask = common.getValueByPath(fromObject, ['updateMask']);
if (parentObject !== undefined && fromUpdateMask != null) {
common.setValueByPath(
Expand Down
4 changes: 4 additions & 0 deletions src/genai/types/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1865,6 +1865,8 @@ export declare interface CreateAgentEngineSessionConfig {
expireTime?: string;
/** Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. */
labels?: Record<string, string>;
/** Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number. */
sessionId?: string;
}

/** Parameters for creating Agent Engine Sessions. */
Expand Down Expand Up @@ -2031,6 +2033,8 @@ export declare interface UpdateAgentEngineSessionConfig {
expireTime?: string;
/** Optional. The labels with user-defined metadata to organize your Sessions. Label keys and values can be no longer than 64 characters (Unicode codepoints), can only contain lowercase letters, numeric characters, underscores and dashes. International characters are allowed. See https://goo.gl/xmQnxf for more information and examples of labels. */
labels?: Record<string, string>;
/** Optional. The user defined ID to use for session, which will become the final component of the session resource name. If not provided, Vertex AI will generate a value for this ID. This value may be up to 63 characters, and valid characters are `[a-z0-9-]`. The first character must be a letter, and the last character must be a letter or number. */
sessionId?: string;
/** The update mask to apply. For the `FieldMask` definition, see
https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask. */
updateMask?: string;
Expand Down
Loading