Documentation
¶
Overview ¶
Copyright 2024 Google LLC
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( TracerName = "github.com/googleapis/genai-toolbox/internal/opentel" MetricName = "github.com/googleapis/genai-toolbox/internal/opentel" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AuthSourceConfigs ¶ added in v0.0.4
type AuthSourceConfigs map[string]auth.AuthSourceConfig
AuthSourceConfigs is a type used to allow unmarshal of the data authSource config map
func (*AuthSourceConfigs) UnmarshalYAML ¶ added in v0.0.4
func (c *AuthSourceConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
type Instrumentation ¶ added in v0.0.5
type Instrumentation struct {
Tracer trace.Tracer
ToolsetGet metric.Int64Counter
ToolGet metric.Int64Counter
ToolInvoke metric.Int64Counter
// contains filtered or unexported fields
}
Instrumentation defines the telemetry instrumentation for toolbox
func CreateTelemetryInstrumentation ¶ added in v0.0.5
func CreateTelemetryInstrumentation(versionString string) (*Instrumentation, error)
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server contains info for running an instance of Toolbox. Should be instantiated with NewServer().
type ServerConfig ¶ added in v0.0.2
type ServerConfig struct {
// Server version
Version string
// Address is the address of the interface the server will listen on.
Address string
// Port is the port the server will listen on.
Port int
// SourceConfigs defines what sources of data are available for tools.
SourceConfigs SourceConfigs
// AuthSourceConfigs defines what sources of authentication are available for tools.
AuthSourceConfigs AuthSourceConfigs
// ToolConfigs defines what tools are available.
ToolConfigs ToolConfigs
// ToolsetConfigs defines what tools are available.
ToolsetConfigs ToolsetConfigs
// LoggingFormat defines whether structured loggings are used.
LoggingFormat logFormat
// LogLevel defines the levels to log.
LogLevel StringLevel
// TelemetryGCP defines whether GCP exporter is used.
TelemetryGCP bool
// TelemetryOTLP defines OTLP collector url for telemetry exports.
TelemetryOTLP string
// TelemetryServiceName defines the value of service.name resource attribute.
TelemetryServiceName string
}
type SourceConfigs ¶ added in v0.0.2
type SourceConfigs map[string]sources.SourceConfig
SourceConfigs is a type used to allow unmarshal of the data source config map
func (*SourceConfigs) UnmarshalYAML ¶ added in v0.0.2
func (c *SourceConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
type StringLevel ¶ added in v0.0.3
type StringLevel string
func (*StringLevel) Set ¶ added in v0.0.3
func (s *StringLevel) Set(v string) error
validate log level flag
func (*StringLevel) String ¶ added in v0.0.3
func (s *StringLevel) String() string
String is used by both fmt.Print and by Cobra in help text
func (*StringLevel) Type ¶ added in v0.0.3
func (s *StringLevel) Type() string
Type is used in Cobra help text
type ToolConfigs ¶ added in v0.0.2
type ToolConfigs map[string]tools.ToolConfig
ToolConfigs is a type used to allow unmarshal of the tool configs
func (*ToolConfigs) UnmarshalYAML ¶ added in v0.0.2
func (c *ToolConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error
type ToolsetConfigs ¶ added in v0.0.2
type ToolsetConfigs map[string]tools.ToolsetConfig
ToolConfigs is a type used to allow unmarshal of the toolset configs
func (*ToolsetConfigs) UnmarshalYAML ¶ added in v0.0.2
func (c *ToolsetConfigs) UnmarshalYAML(unmarshal func(interface{}) error) error