event

package
v1.34.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataPoint

type DataPoint struct {
	TimeStamp            int64   `json:"timeStamp"`
	NumberOfRequests     int64   `json:"numberOfRequests"`
	CostInUsd            float64 `json:"costInUsd"`
	LatencyInMs          int     `json:"latencyInMs"`
	PromptTokenCount     int     `json:"promptTokenCount"`
	CompletionTokenCount int     `json:"completionTokenCount"`
	SuccessCount         int     `json:"successCount"`
	Model                string  `json:"model"`
	KeyId                string  `json:"keyId"`
	CustomId             string  `json:"customId"`
	UserId               string  `json:"userId"`
}

type Event

type Event struct {
	Id                   string   `json:"id"`
	CreatedAt            int64    `json:"created_at"`
	Tags                 []string `json:"tags"`
	KeyId                string   `json:"key_id"`
	CostInUsd            float64  `json:"cost_in_usd"`
	Provider             string   `json:"provider"`
	Model                string   `json:"model"`
	Status               int      `json:"status"`
	PromptTokenCount     int      `json:"prompt_token_count"`
	CompletionTokenCount int      `json:"completion_token_count"`
	LatencyInMs          int      `json:"latency_in_ms"`
	Path                 string   `json:"path"`
	Method               string   `json:"method"`
	CustomId             string   `json:"custom_id"`
	Request              []byte   `json:"request"`
	Response             []byte   `json:"response"`
	UserId               string   `json:"userId"`
	Action               string   `json:"action"`
	PolicyId             string   `json:"policyId"`
	RouteId              string   `json:"routeId"`
	CorrelationId        string   `json:"correlationId"`
	Metadata             []byte   `json:"metadata"`
}

type EventRequest added in v1.19.0

type EventRequest struct {
	UserIds         []string `json:"userIds"`
	CustomIds       []string `json:"customIds"`
	KeyIds          []string `json:"keyIds"`
	Tags            []string `json:"tags"`
	Start           int64    `json:"start"`
	End             int64    `json:"end"`
	Limit           int      `json:"limit"`
	Offset          int      `json:"offset"`
	RequestContent  string   `json:"requestContent"`
	ResponseContent string   `json:"responseContent"`
	PolicyIds       []string `json:"policyIds"`
	Actions         []string `json:"actions"`
	CostOrder       string   `json:"costOrder"`
	DateOrder       string   `json:"dateOrder"`
	ReturnCount     bool     `json:"returnCount"`
	Status          int      `json:"status"`
}

func (*EventRequest) Validate added in v1.19.0

func (r *EventRequest) Validate() error

type EventResponse added in v1.21.0

type EventResponse struct {
	Events []*Event `json:"events"`
	Count  int      `json:"count"`
}

type EventWithRequestAndContent added in v1.9.0

type EventWithRequestAndContent struct {
	Event               *Event
	IsEmbeddingsRequest bool
	RouteConfig         *custom.RouteConfig
	Request             interface{}
	Content             string
	Response            interface{}
	Key                 *key.ResponseKey
	CostMap             *provider.CostMap
}

type KeyDataPoint added in v1.18.0

type KeyDataPoint struct {
	KeyId     string  `json:"keyId"`
	CostInUsd float64 `json:"costInUsd"`
}

type KeyReportingRequest added in v1.18.0

type KeyReportingRequest struct {
	Tags    []string `json:"tags"`
	Order   string   `json:"order"`
	KeyIds  []string `json:"keyIds"`
	Start   int64    `json:"start"`
	End     int64    `json:"end"`
	Limit   int      `json:"limit"`
	Offset  int      `json:"offset"`
	Name    string   `json:"name"`
	Revoked *bool    `json:"revoked"`
}

type KeyReportingResponse added in v1.18.0

type KeyReportingResponse struct {
	DataPoints []*KeyDataPoint `json:"dataPoints"`
}

type ReportingRequest

type ReportingRequest struct {
	KeyIds    []string `json:"keyIds"`
	Tags      []string `json:"tags"`
	CustomIds []string `json:"customIds"`
	UserIds   []string `json:"userIds"`
	Start     int64    `json:"start"`
	End       int64    `json:"end"`
	Increment int64    `json:"increment"`
	Filters   []string `json:"filters"`
}

type ReportingResponse

type ReportingResponse struct {
	DataPoints        []*DataPoint `json:"dataPoints"`
	LatencyInMsMedian float64      `json:"latencyInMsMedian"`
	LatencyInMs99th   float64      `json:"latencyInMs99th"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL