logging

package
v0.0.0-...-faf3a0e Latest Latest
Warning

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

Go to latest
Published: Jul 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(msg string, additionalFields ...Field)

func Error

func Error(msg string, err error, additionalFields ...Field)

func Fatal

func Fatal(msg string, additionalFields ...Field)

func Info

func Info(msg string, additionalFields ...Field)

func InitializeStandardLogger

func InitializeStandardLogger()

func Warn

func Warn(msg string, additionalFields ...Field)

Types

type ChatLogger

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

func NewChatLogger

func NewChatLogger(persona string) *ChatLogger

func (*ChatLogger) LogInteraction

func (l *ChatLogger) LogInteraction(incomingLog InteractionLog) error

type Field

type Field = zap.Field

func AddField

func AddField(key string, value interface{}) Field

type InteractionLog

type InteractionLog struct {
	Prompt           interface{} `json:"prompt"`
	ResponseMessage  string      `json:"response"`
	InputTokenCount  int         `json:"inputTokens"`
	OutputTokenCount int         `json:"outputToken"`
	Cost             float64     `json:"cost"`
	FinishReason     string      `json:"finish_reason"`
}

Jump to

Keyboard shortcuts

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