models

package
v2.5.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 30, 2026 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

package models defines Request / Response models for generic Query and for more focused methods

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CreateSessionInput

type CreateSessionInput struct {
	UserID string         `json:"user_id"`
	State  map[string]any `json:"state,omitempty"`
}

CreateSessionInput contains input parameters

type CreateSessionRequest

type CreateSessionRequest struct {
	ClassMethod string             `json:"class_method"`
	Input       CreateSessionInput `json:"input"`
}

CreateSessionRequest represents an request aligned with aiplatform standard

type CreateSessionResponse

type CreateSessionResponse struct {
	Output SessionData `json:"output"`
}

CreateSessionResponse contains response

type DeleteSessionInput

type DeleteSessionInput struct {
	UserID    string `json:"user_id"`
	SessionID string `json:"session_id"`
}

DeleteSessionInput contains input parameters

type DeleteSessionRequest

type DeleteSessionRequest struct {
	ClassMethod string             `json:"class_method"`
	Input       DeleteSessionInput `json:"input"`
}

DeleteSessionRequest represents an request aligned with aiplatform standard

type DeleteSessionResponse

type DeleteSessionResponse struct {
	Output string `json:"output"`
}

DeleteSessionResponse contains response

type GetSessionInput

type GetSessionInput struct {
	UserID    string `json:"user_id"`
	SessionID string `json:"session_id"`
}

GetSessionInput contains input parameters

type GetSessionRequest

type GetSessionRequest struct {
	ClassMethod string          `json:"class_method"`
	Input       GetSessionInput `json:"input"`
}

GetSessionRequest represents an request aligned with aiplatform standard

type GetSessionResponse

type GetSessionResponse struct {
	Output SessionData `json:"output"`
}

GetSessionResponse contains response

type ListSessionInput

type ListSessionInput struct {
	UserID string `json:"user_id"`
}

ListSessionInput contains input parameters

type ListSessionRequest

type ListSessionRequest struct {
	ClassMethod string           `json:"class_method"`
	Input       ListSessionInput `json:"input"`
}

ListSessionRequest represents an request aligned with aiplatform standard

type ListSessionResponse

type ListSessionResponse struct {
	Output Sessions `json:"output"`
}

ListSessionResponse contains response

type Query

type Query struct {
	ClassMethod string `json:"class_method"`
	Input       any    `json:"input"`
}

Query is generic JSON format for payload coming from aiplatform. It has Input field which type is specific to a particular class_method. Other models are providing those structures for particular class_methods

type SessionData

type SessionData struct {
	UserID         string          `json:"user_id"`
	LastUpdateTime float64         `json:"last_update_time"`
	AppName        string          `json:"app_name"`
	ID             string          `json:"id"`
	State          map[string]any  `json:"state"`
	Events         []session.Event `json:"events"`
}

SessionData represents data about the session

func FromSession

func FromSession(sess session.Session) SessionData

type Sessions

type Sessions struct {
	Sessions []SessionData `json:"sessions"`
}

Sessions contains list of sessions

type StreamQueryInput

type StreamQueryInput struct {
	UserID    string        `json:"user_id"`
	SessionID string        `json:"session_id"`
	Message   genai.Content `json:"message"`
}

StreamQueryInput is the actual Input for async_stream_query method.

type StreamQueryRequest

type StreamQueryRequest struct {
	ClassMethod string           `json:"class_method"`
	Input       StreamQueryInput `json:"input"`
}

StreamQueryRequest is a struct representing JSON-encoded payload to async_stream_query method with dedicated Input with full genai.Content.

type StreamQuerySSEResponse

type StreamQuerySSEResponse session.Event

StreamQueryResponse defines the content of event data for async_stream_query method. It is returned as one line with JSON-encoded StreamQuerySSEResponse Please mind that errors are also returned by this method

type StreamQueryTextInput

type StreamQueryTextInput struct {
	UserID    string `json:"user_id"`
	SessionID string `json:"session_id"`
	Message   string `json:"message"`
}

StreamQueryTextInput is the actual Input for async_stream_query method.

type StreamQueryTextRequest

type StreamQueryTextRequest struct {
	ClassMethod string               `json:"class_method"`
	Input       StreamQueryTextInput `json:"input"`
}

StreamQueryTextRequest is a struct representing JSON-encoded payload to async_stream_query method with dedicated Input with simple text as the content.

type StreamingAgentRunWithEventsInput

type StreamingAgentRunWithEventsInput struct {
	RequestJSON string `json:"request_json"`
}

StreamingAgentRunWithEventsInput wraps the actual request payload as JSON. RequestJSON is a JSON-encoded StreamingAgentRunWithEventsRunRequest.

type StreamingAgentRunWithEventsRequest

type StreamingAgentRunWithEventsRequest struct {
	ClassMethod string                           `json:"class_method"`
	Input       StreamingAgentRunWithEventsInput `json:"input"`
}

StreamingAgentRunWithEventsRequest is the JSON-encoded payload for the streaming_agent_run_with_events method.

type StreamingAgentRunWithEventsResponse

type StreamingAgentRunWithEventsResponse struct {
	Events    []*session.Event `json:"events,omitempty"`
	Artifacts []any            `json:"artifacts,omitempty"`
	SessionID string           `json:"session_id,omitempty"`
}

StreamingAgentRunWithEventsResponse is the response envelope expected by Gemini Enterprise for streaming_agent_run_with_events.

type StreamingAgentRunWithEventsRunRequest

type StreamingAgentRunWithEventsRunRequest struct {
	UserID    string        `json:"user_id"`
	SessionID string        `json:"session_id"`
	Message   genai.Content `json:"message"`
}

StreamingAgentRunWithEventsRunRequest is the request decoded from StreamingAgentRunWithEventsInput.RequestJSON.