zep

package module
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Apr 2, 2024 License: MIT Imports: 5 Imported by: 26

README

Zep Go Library

fern shield

The Zep Go library provides convenient access to the Zep API from Go.

Requirements

This module requires Go version >= 1.13.

Installation

Run the following command to use the Zep Go library in your module:

go get github.com/getzep/zep-go

Usage

import (
  "github.com/getzep/zep-go"
  zepclient "github.com/getzep/zep-go/client"
  "github.com/getzep/zep-go/option"
)

client := zepclient.NewClient(
  option.WithAPIKey("<YOUR_API_KEY>"),
)

response, err := client.Collection.Create(
  context.TODO(),
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
)

Optionals

This library models optional primitives and enum types as pointers. This is primarily meant to distinguish default zero values from explicit values (e.g. false for bool and "" for string). A collection of helper functions are provided to easily map a primitive or enum to its pointer-equivalent (e.g. zep.Int).

For example, consider the client.Search.Get endpoint usage below:

response, err := client.Search.Get(
  context.TODO(),
  "22337b13-7853-4e1c-a857-d94ea60b3a53",
  &zep.MemorySearchPayload{
    Name:       zep.Int(100),
    SearchType: zep.SearchTypeSimilarity.Ptr(),
  },
)

Timeouts

Setting a timeout for each individual request is as simple as using the standard context library. Setting a one second timeout for an individual API call looks like the following:

ctx, cancel := context.WithTimeout(context.TODO(), time.Second)
defer cancel()

response, err := client.Collection.Create(
  ctx,
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
)

Request Options

A variety of request options are included to adapt the behavior of the library, which includes configuring authorization tokens, or providing your own instrumented *http.Client. Both of these options are shown below:

client := zepclient.NewClient(
  option.WithAPIKey("<YOUR_API_KEY>"),
  option.WithHTTPClient(
    &http.Client{
      Timeout: 5 * time.Second,
    },
  ),
)

These request options can either be specified on the client so that they're applied on every request (shown above), or for an individual request like so:

response, err := client.Collection.Create(
  ctx,
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
  option.WithAPIKey("<YOUR_API_KEY>"),
)

Providing your own *http.Client is recommended. Otherwise, the http.DefaultClient will be used, and your client will wait indefinitely for a response (unless the per-request, context-based timeout is used).

Automatic Retries

The Zep Go client is instrumented with automatic retries with exponential backoff. A request will be retried as long as the request is deemed retriable and the number of retry attempts has not grown larger than the configured retry limit (default: 2).

A request is deemed retriable when any of the following HTTP status codes is returned:

  • 408 (Timeout)
  • 409 (Conflict)
  • 429 (Too Many Requests)
  • 5XX (Internal Server Errors)

You can use the option.WithMaxAttempts option to configure the maximum retry limit to your liking. For example, if you want to disable retries for the client entirely, you can set this value to 1 like so:

client := zepclient.NewClient(
  option.WithMaxAttempts(1),
)

This can be done for an individual request, too:

response, err := client.Collection.Create(
  ctx,
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
  option.WithMaxAttempts(1),
)

Errors

Structured error types are returned from API calls that return non-success status codes. For example, you can check if the error was due to a bad request (i.e. status code 400) with the following:

response, err := client.Collection.Create(
  ctx,
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
)
if err != nil {
  if badRequestErr, ok := err.(*zep.BadRequestError);
    // Do something with the bad request ...
  }
  return err
}

These errors are also compatible with the errors.Is and errors.As APIs, so you can access the error like so:

response, err := client.Collection.Create(
  ctx,
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
)
if err != nil {
  var badRequestErr *zep.BadRequestError
  if errors.As(err, badRequestErr) {
    // Do something with the bad request ...
  }
  return err
}

If you'd like to wrap the errors with additional information and still retain the ability to access the type with errors.Is and errors.As, you can use the %w directive:

response, err := client.Collection.Create(
  ctx,
  "collectionName",
  &zep.CreateDocumentCollectionRequest{
    Name:                "documentCollectionName",
    EmbeddingDimensions: 3,
  },
)
if err != nil {
  return fmt.Errorf("failed to create collection: %w", err)
}

Contributing

While we value open-source contributions to this SDK, this library is generated programmatically. Additions made directly to this library would have to be moved over to our generation code, otherwise they would be overwritten upon the next generated release. Feel free to open a PR as a proof of concept, but know that we will not be able to merge it as-is. We suggest opening an issue first to discuss with us!

On the other hand, contributions to the README.md are always very welcome!

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Environments = struct {
	Default string
}{
	Default: "https://api.getzep.com/api/v2",
}

Environments defines all of the API environments. These values can be used with the WithBaseURL RequestOption to override the client's default environment, if any.

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to the given bool value.

func Byte

func Byte(b byte) *byte

Byte returns a pointer to the given byte value.

func Complex128

func Complex128(c complex128) *complex128

Complex128 returns a pointer to the given complex128 value.

func Complex64

func Complex64(c complex64) *complex64

Complex64 returns a pointer to the given complex64 value.

func Float32

func Float32(f float32) *float32

Float32 returns a pointer to the given float32 value.

func Float64

func Float64(f float64) *float64

Float64 returns a pointer to the given float64 value.

func Int

func Int(i int) *int

Int returns a pointer to the given int value.

func Int16

func Int16(i int16) *int16

Int16 returns a pointer to the given int16 value.

func Int32

func Int32(i int32) *int32

Int32 returns a pointer to the given int32 value.

func Int64

func Int64(i int64) *int64

Int64 returns a pointer to the given int64 value.

func Int8

func Int8(i int8) *int8

Int8 returns a pointer to the given int8 value.

func MustParseDate

func MustParseDate(date string) time.Time

MustParseDate attempts to parse the given string as a date time.Time, and panics upon failure.

func MustParseDateTime

func MustParseDateTime(datetime string) time.Time

MustParseDateTime attempts to parse the given string as a datetime time.Time, and panics upon failure.

func Rune

func Rune(r rune) *rune

Rune returns a pointer to the given rune value.

func String

func String(s string) *string

String returns a pointer to the given string value.

func Time

func Time(t time.Time) *time.Time

Time returns a pointer to the given time.Time value.

func UUID

func UUID(u uuid.UUID) *uuid.UUID

UUID returns a pointer to the given uuid.UUID value.

func Uint

func Uint(u uint) *uint

Uint returns a pointer to the given uint value.

func Uint16

func Uint16(u uint16) *uint16

Uint16 returns a pointer to the given uint16 value.

func Uint32

func Uint32(u uint32) *uint32

Uint32 returns a pointer to the given uint32 value.

func Uint64

func Uint64(u uint64) *uint64

Uint64 returns a pointer to the given uint64 value.

func Uint8

func Uint8(u uint8) *uint8

Uint8 returns a pointer to the given uint8 value.

func Uintptr

func Uintptr(u uintptr) *uintptr

Uintptr returns a pointer to the given uintptr value.

Types

type APIError

type APIError struct {
	Message *string `json:"message,omitempty" url:"message,omitempty"`
	// contains filtered or unexported fields
}

func (*APIError) String

func (a *APIError) String() string

func (*APIError) UnmarshalJSON

func (a *APIError) UnmarshalJSON(data []byte) error

type BadRequestError

type BadRequestError struct {
	*core.APIError
	Body *APIError
}

func (*BadRequestError) MarshalJSON

func (b *BadRequestError) MarshalJSON() ([]byte, error)

func (*BadRequestError) UnmarshalJSON

func (b *BadRequestError) UnmarshalJSON(data []byte) error

func (*BadRequestError) Unwrap

func (b *BadRequestError) Unwrap() error

type ClassifySessionRequest

type ClassifySessionRequest struct {
	Classes     []string `json:"classes,omitempty" url:"classes,omitempty"`
	Instruction *string  `json:"instruction,omitempty" url:"instruction,omitempty"`
	LastN       *int     `json:"last_n,omitempty" url:"last_n,omitempty"`
	Name        string   `json:"name" url:"name"`
	Persist     *bool    `json:"persist,omitempty" url:"persist,omitempty"`
}

type ClassifySessionResponse

type ClassifySessionResponse struct {
	Class *string `json:"class,omitempty" url:"class,omitempty"`
	Name  *string `json:"name,omitempty" url:"name,omitempty"`
	// contains filtered or unexported fields
}

func (*ClassifySessionResponse) String

func (c *ClassifySessionResponse) String() string

func (*ClassifySessionResponse) UnmarshalJSON

func (c *ClassifySessionResponse) UnmarshalJSON(data []byte) error

type CollectionCreateIndexRequest

type CollectionCreateIndexRequest struct {
	// Force index creation, even if there are too few documents to index
	Force *bool `json:"-" url:"force,omitempty"`
}

type CreateDocumentCollectionRequest

type CreateDocumentCollectionRequest struct {
	Description         *string `json:"description,omitempty" url:"description,omitempty"`
	EmbeddingDimensions int     `json:"embedding_dimensions" url:"embedding_dimensions"`
	// these needs to be pointers so that we can distinguish between false and unset when validating
	IsAutoEmbedded bool                   `json:"is_auto_embedded" url:"is_auto_embedded"`
	Metadata       map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Name           string                 `json:"name" url:"name"`
}

type CreateDocumentRequest

type CreateDocumentRequest struct {
	Content    *string                `json:"content,omitempty" url:"content,omitempty"`
	DocumentID *string                `json:"document_id,omitempty" url:"document_id,omitempty"`
	Embedding  []float64              `json:"embedding,omitempty" url:"embedding,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	// contains filtered or unexported fields
}

func (*CreateDocumentRequest) String

func (c *CreateDocumentRequest) String() string

func (*CreateDocumentRequest) UnmarshalJSON

func (c *CreateDocumentRequest) UnmarshalJSON(data []byte) error

type CreateSessionRequest

type CreateSessionRequest struct {
	Metadata  map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	SessionID *string                `json:"session_id,omitempty" url:"session_id,omitempty"`
	// Must be a pointer to allow for null values
	UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
}

type CreateUserRequest

type CreateUserRequest struct {
	Email     *string                `json:"email,omitempty" url:"email,omitempty"`
	FirstName *string                `json:"first_name,omitempty" url:"first_name,omitempty"`
	LastName  *string                `json:"last_name,omitempty" url:"last_name,omitempty"`
	Metadata  map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	UserID    *string                `json:"user_id,omitempty" url:"user_id,omitempty"`
}

type DocumentCollectionResponse

type DocumentCollectionResponse struct {
	CreatedAt   *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	Description *string `json:"description,omitempty" url:"description,omitempty"`
	// Number of documents in the collection
	DocumentCount *int `json:"document_count,omitempty" url:"document_count,omitempty"`
	// Number of documents with embeddings
	DocumentEmbeddedCount *int                   `json:"document_embedded_count,omitempty" url:"document_embedded_count,omitempty"`
	EmbeddingDimensions   *int                   `json:"embedding_dimensions,omitempty" url:"embedding_dimensions,omitempty"`
	EmbeddingModelName    *string                `json:"embedding_model_name,omitempty" url:"embedding_model_name,omitempty"`
	IsAutoEmbedded        *bool                  `json:"is_auto_embedded,omitempty" url:"is_auto_embedded,omitempty"`
	IsIndexed             *bool                  `json:"is_indexed,omitempty" url:"is_indexed,omitempty"`
	IsNormalized          *bool                  `json:"is_normalized,omitempty" url:"is_normalized,omitempty"`
	Metadata              map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Name                  *string                `json:"name,omitempty" url:"name,omitempty"`
	UpdatedAt             *string                `json:"updated_at,omitempty" url:"updated_at,omitempty"`
	UUID                  *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*DocumentCollectionResponse) String

func (d *DocumentCollectionResponse) String() string

func (*DocumentCollectionResponse) UnmarshalJSON

func (d *DocumentCollectionResponse) UnmarshalJSON(data []byte) error

type DocumentResponse

type DocumentResponse struct {
	Content    *string                `json:"content,omitempty" url:"content,omitempty"`
	CreatedAt  *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	DocumentID *string                `json:"document_id,omitempty" url:"document_id,omitempty"`
	Embedding  []float64              `json:"embedding,omitempty" url:"embedding,omitempty"`
	IsEmbedded *bool                  `json:"is_embedded,omitempty" url:"is_embedded,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	UpdatedAt  *string                `json:"updated_at,omitempty" url:"updated_at,omitempty"`
	UUID       *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*DocumentResponse) String

func (d *DocumentResponse) String() string

func (*DocumentResponse) UnmarshalJSON

func (d *DocumentResponse) UnmarshalJSON(data []byte) error

type DocumentSearchPayload

type DocumentSearchPayload struct {
	// Limit the number of returned documents
	Limit          *int                   `json:"-" url:"limit,omitempty"`
	CollectionName *string                `json:"collection_name,omitempty" url:"collection_name,omitempty"`
	Embedding      []float64              `json:"embedding,omitempty" url:"embedding,omitempty"`
	Metadata       map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	// TODO: implement for documents
	MinScore   *float64    `json:"min_score,omitempty" url:"min_score,omitempty"`
	MmrLambda  *float64    `json:"mmr_lambda,omitempty" url:"mmr_lambda,omitempty"`
	SearchType *SearchType `json:"search_type,omitempty" url:"search_type,omitempty"`
	Text       *string     `json:"text,omitempty" url:"text,omitempty"`
}

type DocumentSearchResult

type DocumentSearchResult struct {
	Content    *string                `json:"content,omitempty" url:"content,omitempty"`
	CreatedAt  *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	DocumentID *string                `json:"document_id,omitempty" url:"document_id,omitempty"`
	Embedding  []float64              `json:"embedding,omitempty" url:"embedding,omitempty"`
	IsEmbedded *bool                  `json:"is_embedded,omitempty" url:"is_embedded,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Score      *float64               `json:"score,omitempty" url:"score,omitempty"`
	UpdatedAt  *string                `json:"updated_at,omitempty" url:"updated_at,omitempty"`
	UUID       *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*DocumentSearchResult) String

func (d *DocumentSearchResult) String() string

func (*DocumentSearchResult) UnmarshalJSON

func (d *DocumentSearchResult) UnmarshalJSON(data []byte) error

type DocumentSearchResultPage

type DocumentSearchResultPage struct {
	CurrentPage *int                    `json:"current_page,omitempty" url:"current_page,omitempty"`
	QueryVector []float64               `json:"query_vector,omitempty" url:"query_vector,omitempty"`
	ResultCount *int                    `json:"result_count,omitempty" url:"result_count,omitempty"`
	Results     []*DocumentSearchResult `json:"results,omitempty" url:"results,omitempty"`
	TotalPages  *int                    `json:"total_pages,omitempty" url:"total_pages,omitempty"`
	// contains filtered or unexported fields
}

func (*DocumentSearchResultPage) String

func (d *DocumentSearchResultPage) String() string

func (*DocumentSearchResultPage) UnmarshalJSON

func (d *DocumentSearchResultPage) UnmarshalJSON(data []byte) error

type GetDocumentListRequest

type GetDocumentListRequest struct {
	DocumentIDs []string `json:"document_ids,omitempty" url:"document_ids,omitempty"`
	UUIDs       []string `json:"uuids,omitempty" url:"uuids,omitempty"`
}

type InternalServerError

type InternalServerError struct {
	*core.APIError
	Body *APIError
}

func (*InternalServerError) MarshalJSON

func (i *InternalServerError) MarshalJSON() ([]byte, error)

func (*InternalServerError) UnmarshalJSON

func (i *InternalServerError) UnmarshalJSON(data []byte) error

func (*InternalServerError) Unwrap

func (i *InternalServerError) Unwrap() error

type Memory

type Memory struct {
	Facts    []string               `json:"facts,omitempty" url:"facts,omitempty"`
	Messages []*Message             `json:"messages,omitempty" url:"messages,omitempty"`
	Metadata map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Summary  *Summary               `json:"summary,omitempty" url:"summary,omitempty"`
	// contains filtered or unexported fields
}

func (*Memory) String

func (m *Memory) String() string

func (*Memory) UnmarshalJSON

func (m *Memory) UnmarshalJSON(data []byte) error

type MemoryGetRequest

type MemoryGetRequest struct {
	// memoryType: perpetual or message_window
	MemoryType *MemoryGetRequestMemoryType `json:"-" url:"memoryType,omitempty"`
	// Last N messages. Overrides memory_window configuration
	Lastn *int `json:"-" url:"lastn,omitempty"`
}

type MemoryGetRequestMemoryType added in v0.0.2

type MemoryGetRequestMemoryType string
const (
	MemoryGetRequestMemoryTypePerpetual        MemoryGetRequestMemoryType = "perpetual"
	MemoryGetRequestMemoryTypeSummaryRetriever MemoryGetRequestMemoryType = "summary_retriever"
	MemoryGetRequestMemoryTypeMessageWindow    MemoryGetRequestMemoryType = "message_window"
)

func NewMemoryGetRequestMemoryTypeFromString added in v0.0.2

func NewMemoryGetRequestMemoryTypeFromString(s string) (MemoryGetRequestMemoryType, error)

func (MemoryGetRequestMemoryType) Ptr added in v0.0.2

type MemorySearchPayload

type MemorySearchPayload struct {
	// Limit the number of results returned
	Limit       *int                   `json:"-" url:"limit,omitempty"`
	Embedding   []float64              `json:"embedding,omitempty" url:"embedding,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	MinScore    *float64               `json:"min_score,omitempty" url:"min_score,omitempty"`
	MmrLambda   *float64               `json:"mmr_lambda,omitempty" url:"mmr_lambda,omitempty"`
	SearchScope *SearchScope           `json:"search_scope,omitempty" url:"search_scope,omitempty"`
	SearchType  *SearchType            `json:"search_type,omitempty" url:"search_type,omitempty"`
	Text        *string                `json:"text,omitempty" url:"text,omitempty"`
}

type MemorySearchResult

type MemorySearchResult struct {
	Embedding []float64              `json:"embedding,omitempty" url:"embedding,omitempty"`
	Message   *Message               `json:"message,omitempty" url:"message,omitempty"`
	Metadata  map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Score     *float64               `json:"score,omitempty" url:"score,omitempty"`
	Summary   *Summary               `json:"summary,omitempty" url:"summary,omitempty"`
	// contains filtered or unexported fields
}

func (*MemorySearchResult) String

func (m *MemorySearchResult) String() string

func (*MemorySearchResult) UnmarshalJSON

func (m *MemorySearchResult) UnmarshalJSON(data []byte) error

type MemorySynthesizeQuestionRequest

type MemorySynthesizeQuestionRequest struct {
	// Last N messages
	LastNMessages *int `json:"-" url:"lastNMessages,omitempty"`
}

type Message

type Message struct {
	Content    *string                `json:"content,omitempty" url:"content,omitempty"`
	CreatedAt  *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	Role       *string                `json:"role,omitempty" url:"role,omitempty"`
	RoleType   *ModelsRoleType        `json:"role_type,omitempty" url:"role_type,omitempty"`
	TokenCount *int                   `json:"token_count,omitempty" url:"token_count,omitempty"`
	UpdatedAt  *string                `json:"updated_at,omitempty" url:"updated_at,omitempty"`
	UUID       *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) String

func (m *Message) String() string

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

type ModelsRoleType added in v0.0.2

type ModelsRoleType string
const (
	ModelsRoleTypeNoRole        ModelsRoleType = "norole"
	ModelsRoleTypeSystemRole    ModelsRoleType = "system"
	ModelsRoleTypeAssistantRole ModelsRoleType = "assistant"
	ModelsRoleTypeUserRole      ModelsRoleType = "user"
	ModelsRoleTypeFunctionRole  ModelsRoleType = "function"
	ModelsRoleTypeToolRole      ModelsRoleType = "tool"
)

func NewModelsRoleTypeFromString added in v0.0.2

func NewModelsRoleTypeFromString(s string) (ModelsRoleType, error)

func (ModelsRoleType) Ptr added in v0.0.2

func (m ModelsRoleType) Ptr() *ModelsRoleType

type NotFoundError

type NotFoundError struct {
	*core.APIError
	Body *APIError
}

func (*NotFoundError) MarshalJSON

func (n *NotFoundError) MarshalJSON() ([]byte, error)

func (*NotFoundError) UnmarshalJSON

func (n *NotFoundError) UnmarshalJSON(data []byte) error

func (*NotFoundError) Unwrap

func (n *NotFoundError) Unwrap() error

type Question

type Question struct {
	Question *string `json:"question,omitempty" url:"question,omitempty"`
	// contains filtered or unexported fields
}

func (*Question) String

func (q *Question) String() string

func (*Question) UnmarshalJSON

func (q *Question) UnmarshalJSON(data []byte) error

type SearchScope

type SearchScope string
const (
	SearchScopeMessages SearchScope = "messages"
	SearchScopeSummary  SearchScope = "summary"
)

func NewSearchScopeFromString

func NewSearchScopeFromString(s string) (SearchScope, error)

func (SearchScope) Ptr

func (s SearchScope) Ptr() *SearchScope

type SearchType

type SearchType string
const (
	SearchTypeSimilarity SearchType = "similarity"
	SearchTypeMmr        SearchType = "mmr"
)

func NewSearchTypeFromString

func NewSearchTypeFromString(s string) (SearchType, error)

func (SearchType) Ptr

func (s SearchType) Ptr() *SearchType

type Session

type Session struct {
	Classifications map[string]string      `json:"classifications,omitempty" url:"classifications,omitempty"`
	CreatedAt       *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	DeletedAt       *string                `json:"deleted_at,omitempty" url:"deleted_at,omitempty"`
	Facts           []string               `json:"facts,omitempty" url:"facts,omitempty"`
	ID              *int                   `json:"id,omitempty" url:"id,omitempty"`
	Metadata        map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	ProjectUUID     *string                `json:"project_uuid,omitempty" url:"project_uuid,omitempty"`
	SessionID       *string                `json:"session_id,omitempty" url:"session_id,omitempty"`
	UpdatedAt       *string                `json:"updated_at,omitempty" url:"updated_at,omitempty"`
	// Must be a pointer to allow for null values
	UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
	UUID   *string `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*Session) String

func (s *Session) String() string

func (*Session) UnmarshalJSON

func (s *Session) UnmarshalJSON(data []byte) error

type SessionListRequest

type SessionListRequest struct {
	// Limit the number of results returned
	Limit *int `json:"-" url:"limit,omitempty"`
	// Cursor for pagination
	Cursor *int `json:"-" url:"cursor,omitempty"`
}

type Summary

type Summary struct {
	Content             *string                `json:"content,omitempty" url:"content,omitempty"`
	CreatedAt           *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	Metadata            map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	RelatedMessageUUIDs []string               `json:"related_message_uuids,omitempty" url:"related_message_uuids,omitempty"`
	TokenCount          *int                   `json:"token_count,omitempty" url:"token_count,omitempty"`
	UUID                *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*Summary) String

func (s *Summary) String() string

func (*Summary) UnmarshalJSON

func (s *Summary) UnmarshalJSON(data []byte) error

type SummaryListResponse

type SummaryListResponse struct {
	RowCount   *int       `json:"row_count,omitempty" url:"row_count,omitempty"`
	Summaries  []*Summary `json:"summaries,omitempty" url:"summaries,omitempty"`
	TotalCount *int       `json:"total_count,omitempty" url:"total_count,omitempty"`
	// contains filtered or unexported fields
}

func (*SummaryListResponse) String

func (s *SummaryListResponse) String() string

func (*SummaryListResponse) UnmarshalJSON

func (s *SummaryListResponse) UnmarshalJSON(data []byte) error

type UnauthorizedError

type UnauthorizedError struct {
	*core.APIError
	Body *APIError
}

func (*UnauthorizedError) MarshalJSON

func (u *UnauthorizedError) MarshalJSON() ([]byte, error)

func (*UnauthorizedError) UnmarshalJSON

func (u *UnauthorizedError) UnmarshalJSON(data []byte) error

func (*UnauthorizedError) Unwrap

func (u *UnauthorizedError) Unwrap() error

type UpdateDocumentCollectionRequest

type UpdateDocumentCollectionRequest struct {
	Description *string                `json:"description,omitempty" url:"description,omitempty"`
	Metadata    map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
}

type UpdateDocumentListRequest

type UpdateDocumentListRequest struct {
	DocumentID *string                `json:"document_id,omitempty" url:"document_id,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	UUID       string                 `json:"uuid" url:"uuid"`
	// contains filtered or unexported fields
}

func (*UpdateDocumentListRequest) String

func (u *UpdateDocumentListRequest) String() string

func (*UpdateDocumentListRequest) UnmarshalJSON

func (u *UpdateDocumentListRequest) UnmarshalJSON(data []byte) error

type UpdateDocumentRequest

type UpdateDocumentRequest struct {
	DocumentID *string                `json:"document_id,omitempty" url:"document_id,omitempty"`
	Metadata   map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
}

type UpdateSessionRequest

type UpdateSessionRequest struct {
	Metadata  map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	SessionID *string                `json:"session_id,omitempty" url:"session_id,omitempty"`
}

type UpdateUserRequest

type UpdateUserRequest struct {
	Email     *string                `json:"email,omitempty" url:"email,omitempty"`
	FirstName *string                `json:"first_name,omitempty" url:"first_name,omitempty"`
	LastName  *string                `json:"last_name,omitempty" url:"last_name,omitempty"`
	Metadata  map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	UserID    *string                `json:"user_id,omitempty" url:"user_id,omitempty"`
	UUID      *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
}

type User

type User struct {
	CreatedAt    *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	DeletedAt    *string                `json:"deleted_at,omitempty" url:"deleted_at,omitempty"`
	Email        *string                `json:"email,omitempty" url:"email,omitempty"`
	FirstName    *string                `json:"first_name,omitempty" url:"first_name,omitempty"`
	ID           *int                   `json:"id,omitempty" url:"id,omitempty"`
	LastName     *string                `json:"last_name,omitempty" url:"last_name,omitempty"`
	Metadata     map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	ProjectUUID  *string                `json:"project_uuid,omitempty" url:"project_uuid,omitempty"`
	SessionCount *int                   `json:"session_count,omitempty" url:"session_count,omitempty"`
	UpdatedAt    *string                `json:"updated_at,omitempty" url:"updated_at,omitempty"`
	UserID       *string                `json:"user_id,omitempty" url:"user_id,omitempty"`
	UUID         *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*User) String

func (u *User) String() string

func (*User) UnmarshalJSON

func (u *User) UnmarshalJSON(data []byte) error

type UserListOrderedRequest

type UserListOrderedRequest struct {
	// Limit
	Limit *int `json:"-" url:"limit,omitempty"`
	// Cursor
	Cursor *int `json:"-" url:"cursor,omitempty"`
}

type UserListRequest

type UserListRequest struct {
	// Page number for pagination, starting from 1
	PageNumber *int `json:"-" url:"pageNumber,omitempty"`
	// Number of users to retrieve per page
	PageSize *int `json:"-" url:"pageSize,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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