Skip to content

How to pass customer metadata into ADK invocation deployed on Agent Engine #1288

Answered by lupuletic
lupuletic asked this question in Q&A
Discussion options

You must be logged in to vote

figured it out -- you can create a session and pass metadata into the "state", under "input"

here is an example

 const baseEndpoint = `https://${VERTEX_AI_LOCATION}-aiplatform.googleapis.com/v1beta1/projects/${VERTEX_AI_PROJECT}/locations/${VERTEX_AI_LOCATION}/reasoningEngines/${REASONING_ENGINE_ID}`;

  const sessionResponse = await fetch(`${baseEndpoint}:query`, {
    method: 'POST',
    headers: {
      Authorization: `Bearer ${accessToken}`,
      'Content-Type': 'application/json',
    },
    body: JSON.stringify({
      classMethod: 'async_create_session',
      input: {
        user_id: sessionUserId,
        state: sessionState,
      },
    }),
  });

  if (!sessionResponse.ok) {…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by lupuletic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant