v1

package
v1.2.1 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var APIUsageService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "llmariner.apiusage.server.v1.APIUsageService",
	HandlerType: (*APIUsageServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetAggregatedSummary",
			Handler:    _APIUsageService_GetAggregatedSummary_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/usage_server.proto",
}

APIUsageService_ServiceDesc is the grpc.ServiceDesc for APIUsageService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var CollectionInternalService_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "llmariner.apiusage.server.v1.CollectionInternalService",
	HandlerType: (*CollectionInternalServiceServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "CreateUsage",
			Handler:    _CollectionInternalService_CreateUsage_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "api/v1/collector_server.proto",
}

CollectionInternalService_ServiceDesc is the grpc.ServiceDesc for CollectionInternalService service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

View Source
var File_api_v1_collector_server_proto protoreflect.FileDescriptor
View Source
var File_api_v1_usage_server_proto protoreflect.FileDescriptor

Functions

func RegisterAPIUsageServiceServer added in v0.10.0

func RegisterAPIUsageServiceServer(s grpc.ServiceRegistrar, srv APIUsageServiceServer)

func RegisterCollectionInternalServiceServer

func RegisterCollectionInternalServiceServer(s grpc.ServiceRegistrar, srv CollectionInternalServiceServer)

Types

type APIUsageServiceClient added in v0.10.0

type APIUsageServiceClient interface {
	GetAggregatedSummary(ctx context.Context, in *GetAggregatedSummaryRequest, opts ...grpc.CallOption) (*AggregatedSummary, error)
}

APIUsageServiceClient is the client API for APIUsageService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

func NewAPIUsageServiceClient added in v0.10.0

func NewAPIUsageServiceClient(cc grpc.ClientConnInterface) APIUsageServiceClient

type APIUsageServiceServer added in v0.10.0

type APIUsageServiceServer interface {
	GetAggregatedSummary(context.Context, *GetAggregatedSummaryRequest) (*AggregatedSummary, error)
	// contains filtered or unexported methods
}

APIUsageServiceServer is the server API for APIUsageService service. All implementations must embed UnimplementedAPIUsageServiceServer for forward compatibility

type AggregatedSummary added in v0.10.0

type AggregatedSummary struct {
	Summary         *Summary   `protobuf:"bytes,1,opt,name=summary,proto3" json:"summary,omitempty"`
	MethodSummaries []*Summary `protobuf:"bytes,2,rep,name=method_summaries,json=methodSummaries,proto3" json:"method_summaries,omitempty"`
	// contains filtered or unexported fields
}

func (*AggregatedSummary) Descriptor deprecated added in v0.10.0

func (*AggregatedSummary) Descriptor() ([]byte, []int)

Deprecated: Use AggregatedSummary.ProtoReflect.Descriptor instead.

func (*AggregatedSummary) GetMethodSummaries added in v0.10.0

func (x *AggregatedSummary) GetMethodSummaries() []*Summary

func (*AggregatedSummary) GetSummary added in v0.10.0

func (x *AggregatedSummary) GetSummary() *Summary

func (*AggregatedSummary) ProtoMessage added in v0.10.0

func (*AggregatedSummary) ProtoMessage()

func (*AggregatedSummary) ProtoReflect added in v0.10.0

func (x *AggregatedSummary) ProtoReflect() protoreflect.Message

func (*AggregatedSummary) Reset added in v0.10.0

func (x *AggregatedSummary) Reset()

func (*AggregatedSummary) String added in v0.10.0

func (x *AggregatedSummary) String() string

type CollectionInternalServiceClient

type CollectionInternalServiceClient interface {
	CreateUsage(ctx context.Context, in *CreateUsageRequest, opts ...grpc.CallOption) (*Usage, error)
}

CollectionInternalServiceClient is the client API for CollectionInternalService service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

type CollectionInternalServiceServer

type CollectionInternalServiceServer interface {
	CreateUsage(context.Context, *CreateUsageRequest) (*Usage, error)
	// contains filtered or unexported methods
}

CollectionInternalServiceServer is the server API for CollectionInternalService service. All implementations must embed UnimplementedCollectionInternalServiceServer for forward compatibility

type CreateChatCompletion added in v0.12.0

type CreateChatCompletion struct {
	ModelId string `protobuf:"bytes,1,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"`
	// How quickly users start seeing the model's output after entering their query.
	TimeToFirstTokenMs int32 `protobuf:"varint,2,opt,name=time_to_first_token_ms,json=timeToFirstTokenMs,proto3" json:"time_to_first_token_ms,omitempty"`
	// The number off tokens in the prompt.
	PromptTokens int32 `protobuf:"varint,3,opt,name=prompt_tokens,json=promptTokens,proto3" json:"prompt_tokens,omitempty"`
	// The number of tokens in the completion.
	CompletionTokens int32 `protobuf:"varint,4,opt,name=completion_tokens,json=completionTokens,proto3" json:"completion_tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateChatCompletion) Descriptor deprecated added in v0.12.0

func (*CreateChatCompletion) Descriptor() ([]byte, []int)

Deprecated: Use CreateChatCompletion.ProtoReflect.Descriptor instead.

func (*CreateChatCompletion) GetCompletionTokens added in v0.12.0

func (x *CreateChatCompletion) GetCompletionTokens() int32

func (*CreateChatCompletion) GetModelId added in v0.12.0

func (x *CreateChatCompletion) GetModelId() string

func (*CreateChatCompletion) GetPromptTokens added in v0.12.0

func (x *CreateChatCompletion) GetPromptTokens() int32

func (*CreateChatCompletion) GetTimeToFirstTokenMs added in v0.12.0

func (x *CreateChatCompletion) GetTimeToFirstTokenMs() int32

func (*CreateChatCompletion) ProtoMessage added in v0.12.0

func (*CreateChatCompletion) ProtoMessage()

func (*CreateChatCompletion) ProtoReflect added in v0.12.0

func (x *CreateChatCompletion) ProtoReflect() protoreflect.Message

func (*CreateChatCompletion) Reset added in v0.12.0

func (x *CreateChatCompletion) Reset()

func (*CreateChatCompletion) String added in v0.12.0

func (x *CreateChatCompletion) String() string

type CreateCompletion added in v0.12.0

type CreateCompletion struct {
	ModelId string `protobuf:"bytes,1,opt,name=model_id,json=modelId,proto3" json:"model_id,omitempty"`
	// How quickly users start seeing the model's output after entering their query.
	TimeToFirstTokenMs int32 `protobuf:"varint,2,opt,name=time_to_first_token_ms,json=timeToFirstTokenMs,proto3" json:"time_to_first_token_ms,omitempty"`
	// The number off tokens in the prompt.
	PromptTokens int32 `protobuf:"varint,3,opt,name=prompt_tokens,json=promptTokens,proto3" json:"prompt_tokens,omitempty"`
	// The number of tokens in the completion.
	CompletionTokens int32 `protobuf:"varint,4,opt,name=completion_tokens,json=completionTokens,proto3" json:"completion_tokens,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateCompletion) Descriptor deprecated added in v0.12.0

func (*CreateCompletion) Descriptor() ([]byte, []int)

Deprecated: Use CreateCompletion.ProtoReflect.Descriptor instead.

func (*CreateCompletion) GetCompletionTokens added in v0.12.0

func (x *CreateCompletion) GetCompletionTokens() int32

func (*CreateCompletion) GetModelId added in v0.12.0

func (x *CreateCompletion) GetModelId() string

func (*CreateCompletion) GetPromptTokens added in v0.12.0

func (x *CreateCompletion) GetPromptTokens() int32

func (*CreateCompletion) GetTimeToFirstTokenMs added in v0.12.0

func (x *CreateCompletion) GetTimeToFirstTokenMs() int32

func (*CreateCompletion) ProtoMessage added in v0.12.0

func (*CreateCompletion) ProtoMessage()

func (*CreateCompletion) ProtoReflect added in v0.12.0

func (x *CreateCompletion) ProtoReflect() protoreflect.Message

func (*CreateCompletion) Reset added in v0.12.0

func (x *CreateCompletion) Reset()

func (*CreateCompletion) String added in v0.12.0

func (x *CreateCompletion) String() string

type CreateUsageRequest

type CreateUsageRequest struct {
	Records []*UsageRecord `protobuf:"bytes,1,rep,name=records,proto3" json:"records,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateUsageRequest) Descriptor deprecated

func (*CreateUsageRequest) Descriptor() ([]byte, []int)

Deprecated: Use CreateUsageRequest.ProtoReflect.Descriptor instead.

func (*CreateUsageRequest) GetRecords

func (x *CreateUsageRequest) GetRecords() []*UsageRecord

func (*CreateUsageRequest) ProtoMessage

func (*CreateUsageRequest) ProtoMessage()

func (*CreateUsageRequest) ProtoReflect

func (x *CreateUsageRequest) ProtoReflect() protoreflect.Message

func (*CreateUsageRequest) Reset

func (x *CreateUsageRequest) Reset()

func (*CreateUsageRequest) String

func (x *CreateUsageRequest) String() string

type GetAggregatedSummaryRequest added in v0.10.0

type GetAggregatedSummaryRequest struct {
	TenantId string `protobuf:"bytes,1,opt,name=tenant_id,json=tenantId,proto3" json:"tenant_id,omitempty"`
	// star_time is the UNIX timestamp for the summary start time (inclusive).
	// If start_time is not provided, the default is the 24 hours before end_time.
	StartTime int64 `protobuf:"varint,2,opt,name=start_time,json=startTime,proto3" json:"start_time,omitempty"`
	// end_time is the UNIX timestamp for the summary end time (exclusive).
	// If end_time is not provided, the default is the current time.
	EndTime int64 `protobuf:"varint,3,opt,name=end_time,json=endTime,proto3" json:"end_time,omitempty"`
	// contains filtered or unexported fields
}

func (*GetAggregatedSummaryRequest) Descriptor deprecated added in v0.10.0

func (*GetAggregatedSummaryRequest) Descriptor() ([]byte, []int)

Deprecated: Use GetAggregatedSummaryRequest.ProtoReflect.Descriptor instead.

func (*GetAggregatedSummaryRequest) GetEndTime added in v0.10.0

func (x *GetAggregatedSummaryRequest) GetEndTime() int64

func (*GetAggregatedSummaryRequest) GetStartTime added in v0.10.0

func (x *GetAggregatedSummaryRequest) GetStartTime() int64

func (*GetAggregatedSummaryRequest) GetTenantId added in v0.10.0

func (x *GetAggregatedSummaryRequest) GetTenantId() string

func (*GetAggregatedSummaryRequest) ProtoMessage added in v0.10.0

func (*GetAggregatedSummaryRequest) ProtoMessage()

func (*GetAggregatedSummaryRequest) ProtoReflect added in v0.10.0

func (*GetAggregatedSummaryRequest) Reset added in v0.10.0

func (x *GetAggregatedSummaryRequest) Reset()

func (*GetAggregatedSummaryRequest) String added in v0.10.0

func (x *GetAggregatedSummaryRequest) String() string

type Summary added in v0.10.0

type Summary struct {
	Method          string  `protobuf:"bytes,1,opt,name=method,proto3" json:"method,omitempty"`
	TotalRequests   int64   `protobuf:"varint,2,opt,name=total_requests,json=totalRequests,proto3" json:"total_requests,omitempty"`
	SuccessRequests int64   `protobuf:"varint,3,opt,name=success_requests,json=successRequests,proto3" json:"success_requests,omitempty"`
	FailureRequests int64   `protobuf:"varint,4,opt,name=failure_requests,json=failureRequests,proto3" json:"failure_requests,omitempty"`
	AverageLatency  float64 `protobuf:"fixed64,5,opt,name=average_latency,json=averageLatency,proto3" json:"average_latency,omitempty"`
	// contains filtered or unexported fields
}

func (*Summary) Descriptor deprecated added in v0.10.0

func (*Summary) Descriptor() ([]byte, []int)

Deprecated: Use Summary.ProtoReflect.Descriptor instead.

func (*Summary) GetAverageLatency added in v0.10.0

func (x *Summary) GetAverageLatency() float64

func (*Summary) GetFailureRequests added in v0.10.0

func (x *Summary) GetFailureRequests() int64

func (*Summary) GetMethod added in v0.10.0

func (x *Summary) GetMethod() string

func (*Summary) GetSuccessRequests added in v0.10.0

func (x *Summary) GetSuccessRequests() int64

func (*Summary) GetTotalRequests added in v0.10.0

func (x *Summary) GetTotalRequests() int64

func (*Summary) ProtoMessage added in v0.10.0

func (*Summary) ProtoMessage()

func (*Summary) ProtoReflect added in v0.10.0

func (x *Summary) ProtoReflect() protoreflect.Message

func (*Summary) Reset added in v0.10.0

func (x *Summary) Reset()

func (*Summary) String added in v0.10.0

func (x *Summary) String() string

type UnimplementedAPIUsageServiceServer added in v0.10.0

type UnimplementedAPIUsageServiceServer struct {
}

UnimplementedAPIUsageServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedAPIUsageServiceServer) GetAggregatedSummary added in v0.10.0

type UnimplementedCollectionInternalServiceServer

type UnimplementedCollectionInternalServiceServer struct {
}

UnimplementedCollectionInternalServiceServer must be embedded to have forward compatible implementations.

func (UnimplementedCollectionInternalServiceServer) CreateUsage

type UnsafeAPIUsageServiceServer added in v0.10.0

type UnsafeAPIUsageServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeAPIUsageServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to APIUsageServiceServer will result in compilation errors.

type UnsafeCollectionInternalServiceServer

type UnsafeCollectionInternalServiceServer interface {
	// contains filtered or unexported methods
}

UnsafeCollectionInternalServiceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to CollectionInternalServiceServer will result in compilation errors.

type Usage

type Usage struct {
	// contains filtered or unexported fields
}

func (*Usage) Descriptor deprecated

func (*Usage) Descriptor() ([]byte, []int)

Deprecated: Use Usage.ProtoReflect.Descriptor instead.

func (*Usage) ProtoMessage

func (*Usage) ProtoMessage()

func (*Usage) ProtoReflect

func (x *Usage) ProtoReflect() protoreflect.Message

func (*Usage) Reset

func (x *Usage) Reset()

func (*Usage) String

func (x *Usage) String() string

type UsageDetails added in v0.12.0

type UsageDetails struct {

	// Types that are assignable to Message:
	//
	//	*UsageDetails_CreateChatCompletion
	//	*UsageDetails_CreateCompletion
	Message isUsageDetails_Message `protobuf_oneof:"message"`
	// contains filtered or unexported fields
}

func (*UsageDetails) Descriptor deprecated added in v0.12.0

func (*UsageDetails) Descriptor() ([]byte, []int)

Deprecated: Use UsageDetails.ProtoReflect.Descriptor instead.

func (*UsageDetails) GetCreateChatCompletion added in v0.12.0

func (x *UsageDetails) GetCreateChatCompletion() *CreateChatCompletion

func (*UsageDetails) GetCreateCompletion added in v0.12.0

func (x *UsageDetails) GetCreateCompletion() *CreateCompletion

func (*UsageDetails) GetMessage added in v0.12.0

func (m *UsageDetails) GetMessage() isUsageDetails_Message

func (*UsageDetails) ProtoMessage added in v0.12.0

func (*UsageDetails) ProtoMessage()

func (*UsageDetails) ProtoReflect added in v0.12.0

func (x *UsageDetails) ProtoReflect() protoreflect.Message

func (*UsageDetails) Reset added in v0.12.0

func (x *UsageDetails) Reset()

func (*UsageDetails) String added in v0.12.0

func (x *UsageDetails) String() string

type UsageDetails_CreateChatCompletion added in v0.12.0

type UsageDetails_CreateChatCompletion struct {
	CreateChatCompletion *CreateChatCompletion `protobuf:"bytes,1,opt,name=create_chat_completion,json=createChatCompletion,proto3,oneof"`
}

type UsageDetails_CreateCompletion added in v0.12.0

type UsageDetails_CreateCompletion struct {
	CreateCompletion *CreateCompletion `protobuf:"bytes,2,opt,name=create_completion,json=createCompletion,proto3,oneof"`
}

type UsageRecord

type UsageRecord struct {

	// user ID is the internal user ID.
	UserId       string        `protobuf:"bytes,1,opt,name=user_id,json=userId,proto3" json:"user_id,omitempty"`
	Tenant       string        `protobuf:"bytes,2,opt,name=tenant,proto3" json:"tenant,omitempty"`
	Organization string        `protobuf:"bytes,3,opt,name=organization,proto3" json:"organization,omitempty"`
	Project      string        `protobuf:"bytes,4,opt,name=project,proto3" json:"project,omitempty"`
	ApiKeyId     string        `protobuf:"bytes,10,opt,name=api_key_id,json=apiKeyId,proto3" json:"api_key_id,omitempty"`
	ApiMethod    string        `protobuf:"bytes,5,opt,name=api_method,json=apiMethod,proto3" json:"api_method,omitempty"`
	StatusCode   int32         `protobuf:"varint,6,opt,name=status_code,json=statusCode,proto3" json:"status_code,omitempty"`
	Timestamp    int64         `protobuf:"varint,7,opt,name=timestamp,proto3" json:"timestamp,omitempty"`
	LatencyMs    int32         `protobuf:"varint,8,opt,name=latency_ms,json=latencyMs,proto3" json:"latency_ms,omitempty"`
	Details      *UsageDetails `protobuf:"bytes,9,opt,name=details,proto3" json:"details,omitempty"`
	// contains filtered or unexported fields
}

func (*UsageRecord) Descriptor deprecated

func (*UsageRecord) Descriptor() ([]byte, []int)

Deprecated: Use UsageRecord.ProtoReflect.Descriptor instead.

func (*UsageRecord) GetApiKeyId added in v0.14.0

func (x *UsageRecord) GetApiKeyId() string

func (*UsageRecord) GetApiMethod

func (x *UsageRecord) GetApiMethod() string

func (*UsageRecord) GetDetails added in v0.12.0

func (x *UsageRecord) GetDetails() *UsageDetails

func (*UsageRecord) GetLatencyMs

func (x *UsageRecord) GetLatencyMs() int32

func (*UsageRecord) GetOrganization

func (x *UsageRecord) GetOrganization() string

func (*UsageRecord) GetProject

func (x *UsageRecord) GetProject() string

func (*UsageRecord) GetStatusCode

func (x *UsageRecord) GetStatusCode() int32

func (*UsageRecord) GetTenant

func (x *UsageRecord) GetTenant() string

func (*UsageRecord) GetTimestamp

func (x *UsageRecord) GetTimestamp() int64

func (*UsageRecord) GetUserId added in v0.9.0

func (x *UsageRecord) GetUserId() string

func (*UsageRecord) ProtoMessage

func (*UsageRecord) ProtoMessage()

func (*UsageRecord) ProtoReflect

func (x *UsageRecord) ProtoReflect() protoreflect.Message

func (*UsageRecord) Reset

func (x *UsageRecord) Reset()

func (*UsageRecord) String

func (x *UsageRecord) String() string

Jump to

Keyboard shortcuts

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