Skip to content

Commit 73207d3

Browse files
vertex-sdk-botcopybara-github
authored andcommitted
feat: Add memory_id to Create Memory
feat: Add raw_event to Append Event PiperOrigin-RevId: 889309558
1 parent c376ea1 commit 73207d3

File tree

3 files changed

+23
-0
lines changed

3 files changed

+23
-0
lines changed

src/genai/converters/_memories_converters.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ export function agentEngineMemoryConfigToVertex(
7979
common.setValueByPath(parentObject, ['metadata'], fromMetadata);
8080
}
8181

82+
const fromMemoryId = common.getValueByPath(fromObject, ['memoryId']);
83+
if (parentObject !== undefined && fromMemoryId != null) {
84+
common.setValueByPath(parentObject, ['_query', 'memoryId'], fromMemoryId);
85+
}
86+
8287
return toObject;
8388
}
8489

@@ -540,6 +545,11 @@ export function updateAgentEngineMemoryConfigToVertex(
540545
common.setValueByPath(parentObject, ['metadata'], fromMetadata);
541546
}
542547

548+
const fromMemoryId = common.getValueByPath(fromObject, ['memoryId']);
549+
if (parentObject !== undefined && fromMemoryId != null) {
550+
common.setValueByPath(parentObject, ['_query', 'memoryId'], fromMemoryId);
551+
}
552+
543553
const fromUpdateMask = common.getValueByPath(fromObject, ['updateMask']);
544554
if (parentObject !== undefined && fromUpdateMask != null) {
545555
common.setValueByPath(

src/genai/converters/_sessionevents_converters.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ export function appendAgentEngineSessionEventConfigToVertex(
4343
common.setValueByPath(parentObject, ['eventMetadata'], fromEventMetadata);
4444
}
4545

46+
const fromRawEvent = common.getValueByPath(fromObject, ['rawEvent']);
47+
if (parentObject !== undefined && fromRawEvent != null) {
48+
common.setValueByPath(parentObject, ['rawEvent'], fromRawEvent);
49+
}
50+
4651
return toObject;
4752
}
4853

src/genai/types/common.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -961,6 +961,8 @@ export declare interface AgentEngineMemoryConfig {
961961
topics?: MemoryTopicId[];
962962
/** Optional. User-provided metadata for the Memory. This information was provided when creating, updating, or generating the Memory. It was not generated by Memory Bank. */
963963
metadata?: Record<string, MemoryMetadataValue>;
964+
/** Optional. The user defined ID to use for memory, which will become the final component of the memory 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. */
965+
memoryId?: string;
964966
}
965967

966968
/** Parameters for creating Agent Engine Memories. */
@@ -1435,6 +1437,8 @@ export declare interface UpdateAgentEngineMemoryConfig {
14351437
topics?: MemoryTopicId[];
14361438
/** Optional. User-provided metadata for the Memory. This information was provided when creating, updating, or generating the Memory. It was not generated by Memory Bank. */
14371439
metadata?: Record<string, MemoryMetadataValue>;
1440+
/** Optional. The user defined ID to use for memory, which will become the final component of the memory 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. */
1441+
memoryId?: string;
14381442
/** The update mask to apply. For the `FieldMask` definition, see
14391443
https://protobuf.dev/reference/protobuf/google.protobuf/#field-mask. */
14401444
updateMask?: string;
@@ -2094,6 +2098,8 @@ export declare interface AppendAgentEngineSessionEventConfig {
20942098
errorMessage?: string;
20952099
/** Metadata relating to the session event. */
20962100
eventMetadata?: EventMetadata;
2101+
/** Weakly typed raw event data in proto struct format. */
2102+
rawEvent?: Record<string, unknown>;
20972103
}
20982104

20992105
/** Parameters for appending agent engines. */
@@ -2157,6 +2163,8 @@ export declare interface SessionEvent {
21572163
name?: string;
21582164
/** Required. Timestamp when the event was created on client side. */
21592165
timestamp?: string;
2166+
/** Optional. Weakly typed raw event data in proto struct format. */
2167+
rawEvent?: Record<string, unknown>;
21602168
}
21612169

21622170
/** Response for listing agent engine session events. */

0 commit comments

Comments
 (0)