groqerr

package
v0.9.5 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package groqerr provides error types for the groq-go library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type APIError

type APIError struct {
	// Code is the code of the error.
	Code any `json:"code,omitempty"`
	// Message is the message of the error.
	Message string `json:"message"`
	// Param is the param of the error.
	Param *string `json:"param,omitempty"`
	// Type is the type of the error.
	Type string `json:"type"`
	// HTTPStatusCode is the status code of the error.
	HTTPStatusCode int `json:"-"`
}

APIError provides error information returned by the Groq API.

func (*APIError) Error

func (e *APIError) Error() string

Error method implements the error interface on APIError.

func (*APIError) UnmarshalJSON

func (e *APIError) UnmarshalJSON(data []byte) (err error)

UnmarshalJSON implements the json.Unmarshaler interface.

type ErrContentFieldsMisused

type ErrContentFieldsMisused struct{}

ErrContentFieldsMisused is an error that occurs when both Content and MultiContent properties are set.

func (ErrContentFieldsMisused) Error

func (e ErrContentFieldsMisused) Error() string

Error implements the error interface.

type ErrRequest

type ErrRequest struct {
	HTTPStatusCode int
	Err            error
}

ErrRequest is a request error.

func (*ErrRequest) Error

func (e *ErrRequest) Error() string

Error implements the error interface.

func (*ErrRequest) Unwrap

func (e *ErrRequest) Unwrap() error

Unwrap unwraps the error.

type ErrTooManyEmptyStreamMessages

type ErrTooManyEmptyStreamMessages struct{}

ErrTooManyEmptyStreamMessages is returned when the stream has sent too many empty messages.

func (ErrTooManyEmptyStreamMessages) Error

Error returns the error message.

type ErrToolNotFound

type ErrToolNotFound struct {
	ToolName string
}

ErrToolNotFound is returned when a tool is not found.

func (ErrToolNotFound) Error

func (e ErrToolNotFound) Error() string

Error implements the error interface.

type ErrorBuffer

type ErrorBuffer interface {
	io.Writer
	Len() int
	Bytes() []byte
}

ErrorBuffer is a buffer that allows for appending errors.

type ErrorResponse

type ErrorResponse struct {
	Error *APIError `json:"error,omitempty"`
}

ErrorResponse is the response returned by the Groq API.

Jump to

Keyboard shortcuts

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