zep

package module
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 9, 2025 License: Apache-2.0 Imports: 8 Imported by: 0

README

Zep Go Library

Zep Logo

Zep: Long-Term Memory for ‍AI Assistants.

Recall, understand, and extract data from chat histories. Power personalized AI experiences.


Chat on Discord Twitter Follow Go Reference Go Report Card CI CI

Documentation | LangChain | Discord
www.getzep.com

The Zep Go library provides convenient access to the Zep Cloud 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/v3

Initialize Client

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

client := zepclient.NewClient(
  // this api key is `api_secret` line from zep.yaml of your local server or your Zep cloud api-key
  option.WithAPIKey("<YOUR_API_KEY>"),
)

Add Messages to thread

_, err = client.Thread.AddMessages(ctx, threadID, &zep.AddThreadMessagesRequest{
    Messages: []*zep.Message{
        {
            Name:     zep.String("customer"),
            Content:  "Hello, can I buy some shoes?",
            Role:     "user",
        },
    },
})

Get User context

threadUserContext, err := client.Thread.GetUserContext(
    ctx,
    threadID,
    nil,
)

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).

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:

_, _ = client.Thread.GetUserContext(ctx, "thread_id", nil, 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:

_, _ = client.Thread.GetUserContext(ctx, "thread_id", nil, 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:

_, err := client.Thread.GetUserContext(ctx, "thread_id", nil)
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:

_, err := client.Thread.GetUserContext(ctx, "thread_id", nil)
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:

_, err := client.Thread.GetUserContext(ctx, "thread_id", nil)
if err != nil {
  return fmt.Errorf("failed to get memory: %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 ComposeContextString

func ComposeContextString(edges []*EntityEdge, nodes []*EntityNode) string

ComposeContextString composes a search context from entity edges and nodes.

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.

func UnmarshalEdgeAttributes

func UnmarshalEdgeAttributes(attributes map[string]interface{}, dest EdgeDefinition) error

UnmarshalEdgeAttributes unmarshals a map[string]interface{} into a struct that embeds BaseEdge

func UnmarshalNodeAttributes

func UnmarshalNodeAttributes(attributes map[string]interface{}, dest EntityDefinition) error

UnmarshalNodeAttributes unmarshals a map[string]interface{} into a struct that embeds BaseEntity

Types

type APIError

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

func (*APIError) GetExtraProperties

func (a *APIError) GetExtraProperties() map[string]interface{}

func (*APIError) GetMessage

func (a *APIError) GetMessage() *string

func (*APIError) String

func (a *APIError) String() string

func (*APIError) UnmarshalJSON

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

type AddDataBatchRequest

type AddDataBatchRequest struct {
	Episodes []*EpisodeData `json:"episodes,omitempty" url:"-"`
	// graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.
	GraphID *string `json:"graph_id,omitempty" url:"-"`
	// User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.
	UserID *string `json:"user_id,omitempty" url:"-"`
}

type AddDataRequest

type AddDataRequest struct {
	CreatedAt *string `json:"created_at,omitempty" url:"-"`
	Data      string  `json:"data" url:"-"`
	// graph_id is the ID of the graph to which the data will be added. If adding to the user graph, please use user_id field instead.
	GraphID           *string       `json:"graph_id,omitempty" url:"-"`
	SourceDescription *string       `json:"source_description,omitempty" url:"-"`
	Type              GraphDataType `json:"type" url:"-"`
	// User ID is the ID of the user to which the data will be added. If not adding to a user graph, please use graph_id field instead.
	UserID *string `json:"user_id,omitempty" url:"-"`
}

type AddFactsRequest

type AddFactsRequest = interface{}

type AddMemoryRequest

type AddMemoryRequest = interface{}

type AddMemoryResponse

type AddMemoryResponse = interface{}

type AddThreadMessagesRequest

type AddThreadMessagesRequest struct {
	// Optional list of role types to ignore when adding messages to graph memory.
	// The message itself will still be added, retained and used as context for messages
	// that are added to a user's graph.
	IgnoreRoles []RoleType `json:"ignore_roles,omitempty" url:"-"`
	// A list of message objects, where each message contains a role and content.
	Messages []*Message `json:"messages,omitempty" url:"-"`
	// Optionally return memory context relevant to the most recent messages.
	ReturnContext *bool `json:"return_context,omitempty" url:"-"`
}

type AddThreadMessagesResponse

type AddThreadMessagesResponse struct {
	Context *string `json:"context,omitempty" url:"context,omitempty"`
	// contains filtered or unexported fields
}

func (*AddThreadMessagesResponse) GetContext

func (a *AddThreadMessagesResponse) GetContext() *string

func (*AddThreadMessagesResponse) GetExtraProperties

func (a *AddThreadMessagesResponse) GetExtraProperties() map[string]interface{}

func (*AddThreadMessagesResponse) String

func (a *AddThreadMessagesResponse) String() string

func (*AddThreadMessagesResponse) UnmarshalJSON

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

type AddTripleRequest

type AddTripleRequest struct {
	// The timestamp of the message
	CreatedAt *string `json:"created_at,omitempty" url:"-"`
	// The time (if any) at which the edge expires
	ExpiredAt *string `json:"expired_at,omitempty" url:"-"`
	// The fact relating the two nodes that this edge represents
	Fact string `json:"fact" url:"-"`
	// The name of the edge to add. Should be all caps using snake case (eg RELATES_TO)
	FactName string `json:"fact_name" url:"-"`
	// The uuid of the edge to add
	FactUUID *string `json:"fact_uuid,omitempty" url:"-"`
	GraphID  *string `json:"graph_id,omitempty" url:"-"`
	// The time (if any) at which the fact stops being true
	InvalidAt *string `json:"invalid_at,omitempty" url:"-"`
	// The name of the source node to add
	SourceNodeName *string `json:"source_node_name,omitempty" url:"-"`
	// The summary of the source node to add
	SourceNodeSummary *string `json:"source_node_summary,omitempty" url:"-"`
	// The source node uuid
	SourceNodeUUID *string `json:"source_node_uuid,omitempty" url:"-"`
	// The name of the target node to add
	TargetNodeName string `json:"target_node_name" url:"-"`
	// The summary of the target node to add
	TargetNodeSummary *string `json:"target_node_summary,omitempty" url:"-"`
	// The target node uuid
	TargetNodeUUID *string `json:"target_node_uuid,omitempty" url:"-"`
	UserID         *string `json:"user_id,omitempty" url:"-"`
	// The time at which the fact becomes true
	ValidAt *string `json:"valid_at,omitempty" url:"-"`
}

type AddTripleResponse

type AddTripleResponse struct {
	Edge       *EntityEdge `json:"edge,omitempty" url:"edge,omitempty"`
	SourceNode *EntityNode `json:"source_node,omitempty" url:"source_node,omitempty"`
	TargetNode *EntityNode `json:"target_node,omitempty" url:"target_node,omitempty"`
	// contains filtered or unexported fields
}

func (*AddTripleResponse) GetEdge

func (a *AddTripleResponse) GetEdge() *EntityEdge

func (*AddTripleResponse) GetExtraProperties

func (a *AddTripleResponse) GetExtraProperties() map[string]interface{}

func (*AddTripleResponse) GetSourceNode

func (a *AddTripleResponse) GetSourceNode() *EntityNode

func (*AddTripleResponse) GetTargetNode

func (a *AddTripleResponse) GetTargetNode() *EntityNode

func (*AddTripleResponse) String

func (a *AddTripleResponse) String() string

func (*AddTripleResponse) UnmarshalJSON

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

type AddedFact

type AddedFact = interface{}

type AssistantRole

type AssistantRole = interface{}

type BadRequestError

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

Bad Request

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 BaseEdge

type BaseEdge struct{}

type BaseEntity

type BaseEntity struct{}

type ClassifySessionRequest

type ClassifySessionRequest = interface{}

type ClassifySessionResponse

type ClassifySessionResponse = interface{}

type CloneGraphRequest

type CloneGraphRequest struct {
	// source_graph_id is the ID of the graph to be cloned. Required if source_user_id is not provided
	SourceGraphID *string `json:"source_graph_id,omitempty" url:"-"`
	// user_id of the user whose graph is being cloned. Required if source_graph_id is not provided
	SourceUserID *string `json:"source_user_id,omitempty" url:"-"`
	// target_graph_id is the ID to be set on the cloned graph. Must not point to an existing graph. Required if target_user_id is not provided.
	TargetGraphID *string `json:"target_graph_id,omitempty" url:"-"`
	// user_id to be set on the cloned user. Must not point to an existing user. Required if target_graph_id is not provided.
	TargetUserID *string `json:"target_user_id,omitempty" url:"-"`
}

type CloneGraphResponse

type CloneGraphResponse struct {
	// graph_id is the ID of the cloned graph
	GraphID *string `json:"graph_id,omitempty" url:"graph_id,omitempty"`
	UserID  *string `json:"user_id,omitempty" url:"user_id,omitempty"`
	// contains filtered or unexported fields
}

func (*CloneGraphResponse) GetExtraProperties

func (c *CloneGraphResponse) GetExtraProperties() map[string]interface{}

func (*CloneGraphResponse) GetGraphID

func (c *CloneGraphResponse) GetGraphID() *string

func (*CloneGraphResponse) GetUserID

func (c *CloneGraphResponse) GetUserID() *string

func (*CloneGraphResponse) String

func (c *CloneGraphResponse) String() string

func (*CloneGraphResponse) UnmarshalJSON

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

type CommunityNode

type CommunityNode = interface{}

type ComparisonOperator

type ComparisonOperator string
const (
	ComparisonOperatorEquals           ComparisonOperator = "="
	ComparisonOperatorNotEquals        ComparisonOperator = "<>"
	ComparisonOperatorGreaterThan      ComparisonOperator = ">"
	ComparisonOperatorLessThan         ComparisonOperator = "<"
	ComparisonOperatorGreaterThanEqual ComparisonOperator = ">="
	ComparisonOperatorLessThanEqual    ComparisonOperator = "<="
)

func NewComparisonOperatorFromString

func NewComparisonOperatorFromString(s string) (ComparisonOperator, error)

func (ComparisonOperator) Ptr

type CreateDocumentCollectionRequest

type CreateDocumentCollectionRequest = interface{}

type CreateDocumentRequest

type CreateDocumentRequest = interface{}

type CreateGraphRequest

type CreateGraphRequest struct {
	Description           *string                `json:"description,omitempty" url:"-"`
	FactRatingInstruction *FactRatingInstruction `json:"fact_rating_instruction,omitempty" url:"-"`
	GraphID               string                 `json:"graph_id" url:"-"`
	Name                  *string                `json:"name,omitempty" url:"-"`
}

type CreateGroupRequest

type CreateGroupRequest = interface{}

type CreateSessionRequest

type CreateSessionRequest = interface{}

type CreateThreadRequest

type CreateThreadRequest struct {
	// The unique identifier of the thread.
	ThreadID string `json:"thread_id" url:"-"`
	// The unique identifier of the user associated with the thread
	UserID string `json:"user_id" url:"-"`
}

type CreateUserRequest

type CreateUserRequest struct {
	// The email address of the user.
	Email *string `json:"email,omitempty" url:"-"`
	// Optional instruction to use for fact rating.
	FactRatingInstruction *FactRatingInstruction `json:"fact_rating_instruction,omitempty" url:"-"`
	// The first name of the user.
	FirstName *string `json:"first_name,omitempty" url:"-"`
	// The last name of the user.
	LastName *string `json:"last_name,omitempty" url:"-"`
	// The metadata associated with the user.
	Metadata map[string]interface{} `json:"metadata,omitempty" url:"-"`
	// The unique identifier of the user.
	UserID string `json:"user_id" url:"-"`
}

type DateFilter

type DateFilter struct {
	// Comparison operator for date filter
	ComparisonOperator ComparisonOperator `json:"comparison_operator" url:"comparison_operator"`
	// Date to filter on
	Date string `json:"date" url:"date"`
	// contains filtered or unexported fields
}

func (*DateFilter) GetComparisonOperator

func (d *DateFilter) GetComparisonOperator() ComparisonOperator

func (*DateFilter) GetDate

func (d *DateFilter) GetDate() string

func (*DateFilter) GetExtraProperties

func (d *DateFilter) GetExtraProperties() map[string]interface{}

func (*DateFilter) String

func (d *DateFilter) String() string

func (*DateFilter) UnmarshalJSON

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

type DocumentCollectionResponse

type DocumentCollectionResponse = interface{}

type DocumentResponse

type DocumentResponse = interface{}

type DocumentSearchPayload

type DocumentSearchPayload = interface{}

type DocumentSearchResult

type DocumentSearchResult = interface{}

type DocumentSearchResultPage

type DocumentSearchResultPage = interface{}

type EdgeDefinition

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

type EdgeDefinitionWithSourceTargets

type EdgeDefinitionWithSourceTargets struct {
	EdgeModel     EdgeDefinition           `json:"edge_model"`
	SourceTargets []EntityEdgeSourceTarget `json:"source_targets,omitempty"`
}

type EdgeType

type EdgeType struct {
	Description   string                    `json:"description" url:"description"`
	Name          string                    `json:"name" url:"name"`
	Properties    []*EntityProperty         `json:"properties,omitempty" url:"properties,omitempty"`
	SourceTargets []*EntityEdgeSourceTarget `json:"source_targets,omitempty" url:"source_targets,omitempty"`
	// contains filtered or unexported fields
}

func (*EdgeType) GetDescription

func (e *EdgeType) GetDescription() string

func (*EdgeType) GetExtraProperties

func (e *EdgeType) GetExtraProperties() map[string]interface{}

func (*EdgeType) GetName

func (e *EdgeType) GetName() string

func (*EdgeType) GetProperties

func (e *EdgeType) GetProperties() []*EntityProperty

func (*EdgeType) GetSourceTargets

func (e *EdgeType) GetSourceTargets() []*EntityEdgeSourceTarget

func (*EdgeType) String

func (e *EdgeType) String() string

func (*EdgeType) UnmarshalJSON

func (e *EdgeType) UnmarshalJSON(data []byte) error

type EndSessionRequest

type EndSessionRequest = interface{}

type EndSessionResponse

type EndSessionResponse = interface{}

type EndSessionsRequest

type EndSessionsRequest = interface{}

type EndSessionsResponse

type EndSessionsResponse = interface{}

type EntityDefinition

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

type EntityEdge

type EntityEdge struct {
	// Additional attributes of the edge. Dependent on edge types
	Attributes map[string]interface{} `json:"attributes,omitempty" url:"attributes,omitempty"`
	// Creation time of the edge
	CreatedAt string `json:"created_at" url:"created_at"`
	// List of episode ids that reference these entity edges
	Episodes []string `json:"episodes,omitempty" url:"episodes,omitempty"`
	// Datetime of when the node was invalidated
	ExpiredAt *string `json:"expired_at,omitempty" url:"expired_at,omitempty"`
	// Fact representing the edge and nodes that it connects
	Fact string `json:"fact" url:"fact"`
	// Datetime of when the fact stopped being true
	InvalidAt *string `json:"invalid_at,omitempty" url:"invalid_at,omitempty"`
	// Name of the edge, relation name
	Name  string   `json:"name" url:"name"`
	Score *float64 `json:"score,omitempty" url:"score,omitempty"`
	// UUID of the source node
	SourceNodeUUID string `json:"source_node_uuid" url:"source_node_uuid"`
	// UUID of the target node
	TargetNodeUUID string `json:"target_node_uuid" url:"target_node_uuid"`
	// UUID of the edge
	UUID string `json:"uuid" url:"uuid"`
	// Datetime of when the fact became true
	ValidAt *string `json:"valid_at,omitempty" url:"valid_at,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityEdge) GetAttributes

func (e *EntityEdge) GetAttributes() map[string]interface{}

func (*EntityEdge) GetCreatedAt

func (e *EntityEdge) GetCreatedAt() string

func (*EntityEdge) GetEpisodes

func (e *EntityEdge) GetEpisodes() []string

func (*EntityEdge) GetExpiredAt

func (e *EntityEdge) GetExpiredAt() *string

func (*EntityEdge) GetExtraProperties

func (e *EntityEdge) GetExtraProperties() map[string]interface{}

func (*EntityEdge) GetFact

func (e *EntityEdge) GetFact() string

func (*EntityEdge) GetInvalidAt

func (e *EntityEdge) GetInvalidAt() *string

func (*EntityEdge) GetName

func (e *EntityEdge) GetName() string

func (*EntityEdge) GetScore

func (e *EntityEdge) GetScore() *float64

func (*EntityEdge) GetSourceNodeUUID

func (e *EntityEdge) GetSourceNodeUUID() string

func (*EntityEdge) GetTargetNodeUUID

func (e *EntityEdge) GetTargetNodeUUID() string

func (*EntityEdge) GetUUID

func (e *EntityEdge) GetUUID() string

func (*EntityEdge) GetValidAt

func (e *EntityEdge) GetValidAt() *string

func (*EntityEdge) String

func (e *EntityEdge) String() string

func (*EntityEdge) UnmarshalJSON

func (e *EntityEdge) UnmarshalJSON(data []byte) error

type EntityEdgeSourceTarget

type EntityEdgeSourceTarget struct {
	// Source represents the originating node identifier in the edge type relationship. (optional)
	Source *string `json:"source,omitempty" url:"source,omitempty"`
	// Target represents the target node identifier in the edge type relationship. (optional)
	Target *string `json:"target,omitempty" url:"target,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityEdgeSourceTarget) GetExtraProperties

func (e *EntityEdgeSourceTarget) GetExtraProperties() map[string]interface{}

func (*EntityEdgeSourceTarget) GetSource

func (e *EntityEdgeSourceTarget) GetSource() *string

func (*EntityEdgeSourceTarget) GetTarget

func (e *EntityEdgeSourceTarget) GetTarget() *string

func (*EntityEdgeSourceTarget) String

func (e *EntityEdgeSourceTarget) String() string

func (*EntityEdgeSourceTarget) UnmarshalJSON

func (e *EntityEdgeSourceTarget) UnmarshalJSON(data []byte) error

type EntityNode

type EntityNode struct {
	// Additional attributes of the node. Dependent on node labels
	Attributes map[string]interface{} `json:"attributes,omitempty" url:"attributes,omitempty"`
	// Creation time of the node
	CreatedAt string `json:"created_at" url:"created_at"`
	// Labels associated with the node
	Labels []string `json:"labels,omitempty" url:"labels,omitempty"`
	// Name of the node
	Name  string   `json:"name" url:"name"`
	Score *float64 `json:"score,omitempty" url:"score,omitempty"`
	// Regional summary of surrounding edges
	Summary string `json:"summary" url:"summary"`
	// UUID of the node
	UUID string `json:"uuid" url:"uuid"`
	// contains filtered or unexported fields
}

func (*EntityNode) GetAttributes

func (e *EntityNode) GetAttributes() map[string]interface{}

func (*EntityNode) GetCreatedAt

func (e *EntityNode) GetCreatedAt() string

func (*EntityNode) GetExtraProperties

func (e *EntityNode) GetExtraProperties() map[string]interface{}

func (*EntityNode) GetLabels

func (e *EntityNode) GetLabels() []string

func (*EntityNode) GetName

func (e *EntityNode) GetName() string

func (*EntityNode) GetScore

func (e *EntityNode) GetScore() *float64

func (*EntityNode) GetSummary

func (e *EntityNode) GetSummary() string

func (*EntityNode) GetUUID

func (e *EntityNode) GetUUID() string

func (*EntityNode) String

func (e *EntityNode) String() string

func (*EntityNode) UnmarshalJSON

func (e *EntityNode) UnmarshalJSON(data []byte) error

type EntityProperty

type EntityProperty struct {
	Description string             `json:"description" url:"description"`
	Name        string             `json:"name" url:"name"`
	Type        EntityPropertyType `json:"type" url:"type"`
	// contains filtered or unexported fields
}

func (*EntityProperty) GetDescription

func (e *EntityProperty) GetDescription() string

func (*EntityProperty) GetExtraProperties

func (e *EntityProperty) GetExtraProperties() map[string]interface{}

func (*EntityProperty) GetName

func (e *EntityProperty) GetName() string

func (*EntityProperty) GetType

func (e *EntityProperty) GetType() EntityPropertyType

func (*EntityProperty) String

func (e *EntityProperty) String() string

func (*EntityProperty) UnmarshalJSON

func (e *EntityProperty) UnmarshalJSON(data []byte) error

type EntityPropertyType

type EntityPropertyType string
const (
	EntityPropertyTypeText    EntityPropertyType = "Text"
	EntityPropertyTypeInt     EntityPropertyType = "Int"
	EntityPropertyTypeFloat   EntityPropertyType = "Float"
	EntityPropertyTypeBoolean EntityPropertyType = "Boolean"
)

func NewEntityPropertyTypeFromString

func NewEntityPropertyTypeFromString(s string) (EntityPropertyType, error)

func (EntityPropertyType) Ptr

type EntityType

type EntityType struct {
	Description string            `json:"description" url:"description"`
	Name        string            `json:"name" url:"name"`
	Properties  []*EntityProperty `json:"properties,omitempty" url:"properties,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityType) GetDescription

func (e *EntityType) GetDescription() string

func (*EntityType) GetExtraProperties

func (e *EntityType) GetExtraProperties() map[string]interface{}

func (*EntityType) GetName

func (e *EntityType) GetName() string

func (*EntityType) GetProperties

func (e *EntityType) GetProperties() []*EntityProperty

func (*EntityType) String

func (e *EntityType) String() string

func (*EntityType) UnmarshalJSON

func (e *EntityType) UnmarshalJSON(data []byte) error

type EntityTypeRequest

type EntityTypeRequest struct {
	EdgeTypes   []*EdgeType   `json:"edge_types,omitempty" url:"-"`
	EntityTypes []*EntityType `json:"entity_types,omitempty" url:"-"`
	GraphIDs    []string      `json:"graph_ids,omitempty" url:"-"`
	UserIDs     []string      `json:"user_ids,omitempty" url:"-"`
}

type EntityTypeResponse

type EntityTypeResponse struct {
	EdgeTypes   []*EdgeType   `json:"edge_types,omitempty" url:"edge_types,omitempty"`
	EntityTypes []*EntityType `json:"entity_types,omitempty" url:"entity_types,omitempty"`
	// contains filtered or unexported fields
}

func (*EntityTypeResponse) GetEdgeTypes

func (e *EntityTypeResponse) GetEdgeTypes() []*EdgeType

func (*EntityTypeResponse) GetEntityTypes

func (e *EntityTypeResponse) GetEntityTypes() []*EntityType

func (*EntityTypeResponse) GetExtraProperties

func (e *EntityTypeResponse) GetExtraProperties() map[string]interface{}

func (*EntityTypeResponse) String

func (e *EntityTypeResponse) String() string

func (*EntityTypeResponse) UnmarshalJSON

func (e *EntityTypeResponse) UnmarshalJSON(data []byte) error

type Episode

type Episode struct {
	Content   string `json:"content" url:"content"`
	CreatedAt string `json:"created_at" url:"created_at"`
	Processed *bool  `json:"processed,omitempty" url:"processed,omitempty"`
	// Optional role, will only be present if the episode was created using memory.add API
	Role *string `json:"role,omitempty" url:"role,omitempty"`
	// Optional role_type, will only be present if the episode was created using memory.add API
	RoleType          *RoleType      `json:"role_type,omitempty" url:"role_type,omitempty"`
	Score             *float64       `json:"score,omitempty" url:"score,omitempty"`
	SessionID         *string        `json:"session_id,omitempty" url:"session_id,omitempty"`
	Source            *GraphDataType `json:"source,omitempty" url:"source,omitempty"`
	SourceDescription *string        `json:"source_description,omitempty" url:"source_description,omitempty"`
	UUID              string         `json:"uuid" url:"uuid"`
	// contains filtered or unexported fields
}

func (*Episode) GetContent

func (e *Episode) GetContent() string

func (*Episode) GetCreatedAt

func (e *Episode) GetCreatedAt() string

func (*Episode) GetExtraProperties

func (e *Episode) GetExtraProperties() map[string]interface{}

func (*Episode) GetProcessed

func (e *Episode) GetProcessed() *bool

func (*Episode) GetRole

func (e *Episode) GetRole() *string

func (*Episode) GetRoleType

func (e *Episode) GetRoleType() *RoleType

func (*Episode) GetScore

func (e *Episode) GetScore() *float64

func (*Episode) GetSessionID

func (e *Episode) GetSessionID() *string

func (*Episode) GetSource

func (e *Episode) GetSource() *GraphDataType

func (*Episode) GetSourceDescription

func (e *Episode) GetSourceDescription() *string

func (*Episode) GetUUID

func (e *Episode) GetUUID() string

func (*Episode) String

func (e *Episode) String() string

func (*Episode) UnmarshalJSON

func (e *Episode) UnmarshalJSON(data []byte) error

type EpisodeData

type EpisodeData struct {
	CreatedAt         *string       `json:"created_at,omitempty" url:"created_at,omitempty"`
	Data              string        `json:"data" url:"data"`
	SourceDescription *string       `json:"source_description,omitempty" url:"source_description,omitempty"`
	Type              GraphDataType `json:"type" url:"type"`
	// contains filtered or unexported fields
}

func (*EpisodeData) GetCreatedAt

func (e *EpisodeData) GetCreatedAt() *string

func (*EpisodeData) GetData

func (e *EpisodeData) GetData() string

func (*EpisodeData) GetExtraProperties

func (e *EpisodeData) GetExtraProperties() map[string]interface{}

func (*EpisodeData) GetSourceDescription

func (e *EpisodeData) GetSourceDescription() *string

func (*EpisodeData) GetType

func (e *EpisodeData) GetType() GraphDataType

func (*EpisodeData) String

func (e *EpisodeData) String() string

func (*EpisodeData) UnmarshalJSON

func (e *EpisodeData) UnmarshalJSON(data []byte) error

type EpisodeMentions

type EpisodeMentions struct {
	Edges []*EntityEdge `json:"edges,omitempty" url:"edges,omitempty"`
	Nodes []*EntityNode `json:"nodes,omitempty" url:"nodes,omitempty"`
	// contains filtered or unexported fields
}

func (*EpisodeMentions) GetEdges

func (e *EpisodeMentions) GetEdges() []*EntityEdge

func (*EpisodeMentions) GetExtraProperties

func (e *EpisodeMentions) GetExtraProperties() map[string]interface{}

func (*EpisodeMentions) GetNodes

func (e *EpisodeMentions) GetNodes() []*EntityNode

func (*EpisodeMentions) String

func (e *EpisodeMentions) String() string

func (*EpisodeMentions) UnmarshalJSON

func (e *EpisodeMentions) UnmarshalJSON(data []byte) error

type EpisodeResponse

type EpisodeResponse struct {
	Episodes []*Episode `json:"episodes,omitempty" url:"episodes,omitempty"`
	// contains filtered or unexported fields
}

func (*EpisodeResponse) GetEpisodes

func (e *EpisodeResponse) GetEpisodes() []*Episode

func (*EpisodeResponse) GetExtraProperties

func (e *EpisodeResponse) GetExtraProperties() map[string]interface{}

func (*EpisodeResponse) String

func (e *EpisodeResponse) String() string

func (*EpisodeResponse) UnmarshalJSON

func (e *EpisodeResponse) UnmarshalJSON(data []byte) error

type EpisodeType

type EpisodeType = interface{}

type ExtractDataRequest

type ExtractDataRequest = interface{}

type Fact

type Fact = interface{}

type FactRatingExamples

type FactRatingExamples struct {
	High   *string `json:"high,omitempty" url:"high,omitempty"`
	Low    *string `json:"low,omitempty" url:"low,omitempty"`
	Medium *string `json:"medium,omitempty" url:"medium,omitempty"`
	// contains filtered or unexported fields
}

func (*FactRatingExamples) GetExtraProperties

func (f *FactRatingExamples) GetExtraProperties() map[string]interface{}

func (*FactRatingExamples) GetHigh

func (f *FactRatingExamples) GetHigh() *string

func (*FactRatingExamples) GetLow

func (f *FactRatingExamples) GetLow() *string

func (*FactRatingExamples) GetMedium

func (f *FactRatingExamples) GetMedium() *string

func (*FactRatingExamples) String

func (f *FactRatingExamples) String() string

func (*FactRatingExamples) UnmarshalJSON

func (f *FactRatingExamples) UnmarshalJSON(data []byte) error

type FactRatingInstruction

type FactRatingInstruction struct {
	// Examples is a list of examples that demonstrate how facts might be rated based on your instruction. You should provide
	// an example of a highly rated example, a low rated example, and a medium (or in between example). For example, if you are rating
	// based on relevance to a trip planning application, your examples might be:
	// High: "Joe's dream vacation is Bali"
	// Medium: "Joe has a fear of flying",
	// Low: "Joe's favorite food is Japanese",
	Examples *FactRatingExamples `json:"examples,omitempty" url:"examples,omitempty"`
	// A string describing how to rate facts as they apply to your application. A trip planning application may
	// use something like "relevancy to planning a trip, the user's preferences when traveling,
	// or the user's travel history."
	Instruction *string `json:"instruction,omitempty" url:"instruction,omitempty"`
	// contains filtered or unexported fields
}

func (*FactRatingInstruction) GetExamples

func (f *FactRatingInstruction) GetExamples() *FactRatingExamples

func (*FactRatingInstruction) GetExtraProperties

func (f *FactRatingInstruction) GetExtraProperties() map[string]interface{}

func (*FactRatingInstruction) GetInstruction

func (f *FactRatingInstruction) GetInstruction() *string

func (*FactRatingInstruction) String

func (f *FactRatingInstruction) String() string

func (*FactRatingInstruction) UnmarshalJSON

func (f *FactRatingInstruction) UnmarshalJSON(data []byte) error

type FactResponse

type FactResponse = interface{}

type FactsResponse

type FactsResponse = interface{}

type FileParam

type FileParam struct {
	io.Reader
	// contains filtered or unexported fields
}

FileParam is a file type suitable for multipart/form-data uploads.

func NewFileParam

func NewFileParam(
	reader io.Reader,
	filename string,
	contentType string,
	opts ...FileParamOption,
) *FileParam

NewFileParam returns a *FileParam type suitable for multipart/form-data uploads. All file upload endpoints accept a simple io.Reader, which is usually created by opening a file via os.Open.

However, some endpoints require additional metadata about the file such as a specific Content-Type or custom filename. FileParam makes it easier to create the correct type signature for these endpoints.

func (*FileParam) ContentType

func (f *FileParam) ContentType() string

func (*FileParam) Name

func (f *FileParam) Name() string

type FileParamOption

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

FileParamOption adapts the behavior of the FileParam. No options are implemented yet, but this interface allows for future extensibility.

type FunctionRole

type FunctionRole = interface{}

type GetDocumentListRequest

type GetDocumentListRequest = interface{}

type Graph

type Graph struct {
	CreatedAt             *string                `json:"created_at,omitempty" url:"created_at,omitempty"`
	Description           *string                `json:"description,omitempty" url:"description,omitempty"`
	FactRatingInstruction *FactRatingInstruction `json:"fact_rating_instruction,omitempty" url:"fact_rating_instruction,omitempty"`
	GraphID               *string                `json:"graph_id,omitempty" url:"graph_id,omitempty"`
	ID                    *int                   `json:"id,omitempty" url:"id,omitempty"`
	Name                  *string                `json:"name,omitempty" url:"name,omitempty"`
	ProjectUUID           *string                `json:"project_uuid,omitempty" url:"project_uuid,omitempty"`
	UUID                  *string                `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*Graph) GetCreatedAt

func (g *Graph) GetCreatedAt() *string

func (*Graph) GetDescription

func (g *Graph) GetDescription() *string

func (*Graph) GetExtraProperties

func (g *Graph) GetExtraProperties() map[string]interface{}

func (*Graph) GetFactRatingInstruction

func (g *Graph) GetFactRatingInstruction() *FactRatingInstruction

func (*Graph) GetGraphID

func (g *Graph) GetGraphID() *string

func (*Graph) GetID

func (g *Graph) GetID() *int

func (*Graph) GetName

func (g *Graph) GetName() *string

func (*Graph) GetProjectUUID

func (g *Graph) GetProjectUUID() *string

func (*Graph) GetUUID

func (g *Graph) GetUUID() *string

func (*Graph) String

func (g *Graph) String() string

func (*Graph) UnmarshalJSON

func (g *Graph) UnmarshalJSON(data []byte) error

type GraphDataType

type GraphDataType string
const (
	GraphDataTypeText    GraphDataType = "text"
	GraphDataTypeJSON    GraphDataType = "json"
	GraphDataTypeMessage GraphDataType = "message"
)

func NewGraphDataTypeFromString

func NewGraphDataTypeFromString(s string) (GraphDataType, error)

func (GraphDataType) Ptr

func (g GraphDataType) Ptr() *GraphDataType

type GraphEdgesRequest

type GraphEdgesRequest struct {
	// Maximum number of items to return
	Limit *int `json:"limit,omitempty" url:"limit,omitempty"`
	// UUID based cursor, used for pagination. Should be the UUID of the last item in the previous page
	UUIDCursor *string `json:"uuid_cursor,omitempty" url:"uuid_cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*GraphEdgesRequest) GetExtraProperties

func (g *GraphEdgesRequest) GetExtraProperties() map[string]interface{}

func (*GraphEdgesRequest) GetLimit

func (g *GraphEdgesRequest) GetLimit() *int

func (*GraphEdgesRequest) GetUUIDCursor

func (g *GraphEdgesRequest) GetUUIDCursor() *string

func (*GraphEdgesRequest) String

func (g *GraphEdgesRequest) String() string

func (*GraphEdgesRequest) UnmarshalJSON

func (g *GraphEdgesRequest) UnmarshalJSON(data []byte) error

type GraphListAllRequest

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

type GraphListEntityTypesRequest added in v3.1.0

type GraphListEntityTypesRequest struct {
	// User ID to get user-specific entity types
	UserID *string `json:"-" url:"user_id,omitempty"`
	// Graph ID to get graph-specific entity types
	GraphID *string `json:"-" url:"graph_id,omitempty"`
}

type GraphListResponse

type GraphListResponse struct {
	Graphs     []*Graph `json:"graphs,omitempty" url:"graphs,omitempty"`
	RowCount   *int     `json:"row_count,omitempty" url:"row_count,omitempty"`
	TotalCount *int     `json:"total_count,omitempty" url:"total_count,omitempty"`
	// contains filtered or unexported fields
}

func (*GraphListResponse) GetExtraProperties

func (g *GraphListResponse) GetExtraProperties() map[string]interface{}

func (*GraphListResponse) GetGraphs

func (g *GraphListResponse) GetGraphs() []*Graph

func (*GraphListResponse) GetRowCount

func (g *GraphListResponse) GetRowCount() *int

func (*GraphListResponse) GetTotalCount

func (g *GraphListResponse) GetTotalCount() *int

func (*GraphListResponse) String

func (g *GraphListResponse) String() string

func (*GraphListResponse) UnmarshalJSON

func (g *GraphListResponse) UnmarshalJSON(data []byte) error

type GraphNodesRequest

type GraphNodesRequest struct {
	// Maximum number of items to return
	Limit *int `json:"limit,omitempty" url:"limit,omitempty"`
	// UUID based cursor, used for pagination. Should be the UUID of the last item in the previous page
	UUIDCursor *string `json:"uuid_cursor,omitempty" url:"uuid_cursor,omitempty"`
	// contains filtered or unexported fields
}

func (*GraphNodesRequest) GetExtraProperties

func (g *GraphNodesRequest) GetExtraProperties() map[string]interface{}

func (*GraphNodesRequest) GetLimit

func (g *GraphNodesRequest) GetLimit() *int

func (*GraphNodesRequest) GetUUIDCursor

func (g *GraphNodesRequest) GetUUIDCursor() *string

func (*GraphNodesRequest) String

func (g *GraphNodesRequest) String() string

func (*GraphNodesRequest) UnmarshalJSON

func (g *GraphNodesRequest) UnmarshalJSON(data []byte) error

type GraphOntologyOption added in v3.1.0

type GraphOntologyOption func(*GraphOntologyOptions)

GraphOntologyOption is a functional option for configuring graph ontology operations

func ForGraphs added in v3.1.0

func ForGraphs(graphIDs []string) GraphOntologyOption

ForGraphs allows to specify target graph identifiers when setting entity/edge types.

func ForUsers added in v3.1.0

func ForUsers(userIDs []string) GraphOntologyOption

ForUsers allows to specify target user identifiers when setting entity/edge types.

type GraphOntologyOptions added in v3.1.0

type GraphOntologyOptions struct {
	UserIDs  []string
	GraphIDs []string
}

GraphOntologyOptions contains options for graph ontology operations

type GraphSearchQuery

type GraphSearchQuery struct {
	// Nodes that are the origins of the BFS searches
	BfsOriginNodeUUIDs []string `json:"bfs_origin_node_uuids,omitempty" url:"-"`
	// Node to rerank around for node distance reranking
	CenterNodeUUID *string `json:"center_node_uuid,omitempty" url:"-"`
	// The graph_id to search in. When searching user graph, please use user_id instead.
	GraphID *string `json:"graph_id,omitempty" url:"-"`
	// The maximum number of facts to retrieve. Defaults to 10. Limited to 50.
	Limit *int `json:"limit,omitempty" url:"-"`
	// The minimum rating by which to filter relevant facts
	MinFactRating *float64 `json:"min_fact_rating,omitempty" url:"-"`
	// Deprecated
	MinScore *float64 `json:"min_score,omitempty" url:"-"`
	// weighting for maximal marginal relevance
	MmrLambda *float64 `json:"mmr_lambda,omitempty" url:"-"`
	// The string to search for (required)
	Query string `json:"query" url:"-"`
	// Defaults to RRF
	Reranker *Reranker `json:"reranker,omitempty" url:"-"`
	// Defaults to Edges. Communities will be added in the future.
	Scope *GraphSearchScope `json:"scope,omitempty" url:"-"`
	// Search filters to apply to the search
	SearchFilters *SearchFilters `json:"search_filters,omitempty" url:"-"`
	// The user_id when searching user graph. If not searching user graph, please use graph_id instead.
	UserID *string `json:"user_id,omitempty" url:"-"`
}

type GraphSearchResults

type GraphSearchResults struct {
	Edges    []*EntityEdge `json:"edges,omitempty" url:"edges,omitempty"`
	Episodes []*Episode    `json:"episodes,omitempty" url:"episodes,omitempty"`
	Nodes    []*EntityNode `json:"nodes,omitempty" url:"nodes,omitempty"`
	// contains filtered or unexported fields
}

func (*GraphSearchResults) GetEdges

func (g *GraphSearchResults) GetEdges() []*EntityEdge

func (*GraphSearchResults) GetEpisodes

func (g *GraphSearchResults) GetEpisodes() []*Episode

func (*GraphSearchResults) GetExtraProperties

func (g *GraphSearchResults) GetExtraProperties() map[string]interface{}

func (*GraphSearchResults) GetNodes

func (g *GraphSearchResults) GetNodes() []*EntityNode

func (*GraphSearchResults) String

func (g *GraphSearchResults) String() string

func (*GraphSearchResults) UnmarshalJSON

func (g *GraphSearchResults) UnmarshalJSON(data []byte) error

type GraphSearchScope

type GraphSearchScope string
const (
	GraphSearchScopeEdges    GraphSearchScope = "edges"
	GraphSearchScopeNodes    GraphSearchScope = "nodes"
	GraphSearchScopeEpisodes GraphSearchScope = "episodes"
)

func NewGraphSearchScopeFromString

func NewGraphSearchScopeFromString(s string) (GraphSearchScope, error)

func (GraphSearchScope) Ptr

type Group

type Group = interface{}

type GroupListResponse

type GroupListResponse = interface{}

type InternalServerError

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

Internal Server Error

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 = interface{}

type MemorySearchPayload

type MemorySearchPayload = interface{}

type MemorySearchResult

type MemorySearchResult = interface{}

type MemoryType

type MemoryType string
const (
	MemoryTypePerpetual        MemoryType = "perpetual"
	MemoryTypeSummaryRetriever MemoryType = "summary_retriever"
	MemoryTypeMessageWindow    MemoryType = "message_window"
)

func NewMemoryTypeFromString

func NewMemoryTypeFromString(s string) (MemoryType, error)

func (MemoryType) Ptr

func (m MemoryType) Ptr() *MemoryType

type Message

type Message struct {
	// The content of the message.
	Content string `json:"content" url:"content"`
	// The timestamp of when the message was created.
	CreatedAt *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	// Customizable name of the sender of the message (e.g., "john", "sales_agent").
	Name *string `json:"name,omitempty" url:"name,omitempty"`
	// Whether the message has been processed.
	Processed *bool `json:"processed,omitempty" url:"processed,omitempty"`
	// The role of message sender (e.g., "user", "system").
	Role RoleType `json:"role" url:"role"`
	// The unique identifier of the message.
	UUID *string `json:"uuid,omitempty" url:"uuid,omitempty"`
	// contains filtered or unexported fields
}

func (*Message) GetContent

func (m *Message) GetContent() string

func (*Message) GetCreatedAt

func (m *Message) GetCreatedAt() *string

func (*Message) GetExtraProperties

func (m *Message) GetExtraProperties() map[string]interface{}

func (*Message) GetName

func (m *Message) GetName() *string

func (*Message) GetProcessed

func (m *Message) GetProcessed() *bool

func (*Message) GetRole

func (m *Message) GetRole() RoleType

func (*Message) GetUUID

func (m *Message) GetUUID() *string

func (*Message) String

func (m *Message) String() string

func (*Message) UnmarshalJSON

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

type MessageListResponse

type MessageListResponse struct {
	// A list of message objects.
	Messages []*Message `json:"messages,omitempty" url:"messages,omitempty"`
	// The number of messages returned.
	RowCount *int `json:"row_count,omitempty" url:"row_count,omitempty"`
	// The total number of messages.
	TotalCount *int `json:"total_count,omitempty" url:"total_count,omitempty"`
	// contains filtered or unexported fields
}

func (*MessageListResponse) GetExtraProperties

func (m *MessageListResponse) GetExtraProperties() map[string]interface{}

func (*MessageListResponse) GetMessages

func (m *MessageListResponse) GetMessages() []*Message

func (*MessageListResponse) GetRowCount

func (m *MessageListResponse) GetRowCount() *int

func (*MessageListResponse) GetTotalCount

func (m *MessageListResponse) GetTotalCount() *int

func (*MessageListResponse) String

func (m *MessageListResponse) String() string

func (*MessageListResponse) UnmarshalJSON

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

type ModelsFactRatingExamples

type ModelsFactRatingExamples struct {
	High   *string `json:"high,omitempty" url:"high,omitempty"`
	Low    *string `json:"low,omitempty" url:"low,omitempty"`
	Medium *string `json:"medium,omitempty" url:"medium,omitempty"`
	// contains filtered or unexported fields
}

func (*ModelsFactRatingExamples) GetExtraProperties

func (m *ModelsFactRatingExamples) GetExtraProperties() map[string]interface{}

func (*ModelsFactRatingExamples) GetHigh

func (m *ModelsFactRatingExamples) GetHigh() *string

func (*ModelsFactRatingExamples) GetLow

func (m *ModelsFactRatingExamples) GetLow() *string

func (*ModelsFactRatingExamples) GetMedium

func (m *ModelsFactRatingExamples) GetMedium() *string

func (*ModelsFactRatingExamples) String

func (m *ModelsFactRatingExamples) String() string

func (*ModelsFactRatingExamples) UnmarshalJSON

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

type ModelsFactRatingInstruction

type ModelsFactRatingInstruction struct {
	// Examples is a list of examples that demonstrate how facts might be rated based on your instruction. You should provide
	// an example of a highly rated example, a low rated example, and a medium (or in between example). For example, if you are rating
	// based on relevance to a trip planning application, your examples might be:
	// High: "Joe's dream vacation is Bali"
	// Medium: "Joe has a fear of flying",
	// Low: "Joe's favorite food is Japanese",
	Examples *ModelsFactRatingExamples `json:"examples,omitempty" url:"examples,omitempty"`
	// A string describing how to rate facts as they apply to your application. A trip planning application may
	// use something like "relevancy to planning a trip, the user's preferences when traveling,
	// or the user's travel history."
	Instruction *string `json:"instruction,omitempty" url:"instruction,omitempty"`
	// contains filtered or unexported fields
}

func (*ModelsFactRatingInstruction) GetExamples

func (*ModelsFactRatingInstruction) GetExtraProperties

func (m *ModelsFactRatingInstruction) GetExtraProperties() map[string]interface{}

func (*ModelsFactRatingInstruction) GetInstruction

func (m *ModelsFactRatingInstruction) GetInstruction() *string

func (*ModelsFactRatingInstruction) String

func (m *ModelsFactRatingInstruction) String() string

func (*ModelsFactRatingInstruction) UnmarshalJSON

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

type NewFact

type NewFact = interface{}

type NoRole

type NoRole = interface{}

type NotFoundError

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

Not Found

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 = interface{}

type Reranker

type Reranker string
const (
	RerankerRrf             Reranker = "rrf"
	RerankerMmr             Reranker = "mmr"
	RerankerNodeDistance    Reranker = "node_distance"
	RerankerEpisodeMentions Reranker = "episode_mentions"
	RerankerCrossEncoder    Reranker = "cross_encoder"
)

func NewRerankerFromString

func NewRerankerFromString(s string) (Reranker, error)

func (Reranker) Ptr

func (r Reranker) Ptr() *Reranker

type RoleType

type RoleType string
const (
	RoleTypeNoRole        RoleType = "norole"
	RoleTypeSystemRole    RoleType = "system"
	RoleTypeAssistantRole RoleType = "assistant"
	RoleTypeUserRole      RoleType = "user"
	RoleTypeFunctionRole  RoleType = "function"
	RoleTypeToolRole      RoleType = "tool"
)

func NewRoleTypeFromString

func NewRoleTypeFromString(s string) (RoleType, error)

func (RoleType) Ptr

func (r RoleType) Ptr() *RoleType

type SearchFilters

type SearchFilters struct {
	// 2D array of date filters for the created_at field.
	// The outer array elements are combined with OR logic.
	// The inner array elements are combined with AND logic.
	// Example: [[{">", date1}, {"<", date2}], [{"=", date3}]]
	// This translates to: (created_at > date1 AND created_at < date2) OR (created_at = date3)
	CreatedAt [][]*DateFilter `json:"created_at,omitempty" url:"created_at,omitempty"`
	// List of edge types to filter on
	EdgeTypes []string `json:"edge_types,omitempty" url:"edge_types,omitempty"`
	// 2D array of date filters for the expired_at field.
	// The outer array elements are combined with OR logic.
	// The inner array elements are combined with AND logic.
	// Example: [[{">", date1}, {"<", date2}], [{"=", date3}]]
	// This translates to: (expired_at > date1 AND expired_at < date2) OR (expired_at = date3)
	ExpiredAt [][]*DateFilter `json:"expired_at,omitempty" url:"expired_at,omitempty"`
	// 2D array of date filters for the invalid_at field.
	// The outer array elements are combined with OR logic.
	// The inner array elements are combined with AND logic.
	// Example: [[{">", date1}, {"<", date2}], [{"=", date3}]]
	// This translates to: (invalid_at > date1 AND invalid_at < date2) OR (invalid_at = date3)
	InvalidAt [][]*DateFilter `json:"invalid_at,omitempty" url:"invalid_at,omitempty"`
	// List of node labels to filter on
	NodeLabels []string `json:"node_labels,omitempty" url:"node_labels,omitempty"`
	// 2D array of date filters for the valid_at field.
	// The outer array elements are combined with OR logic.
	// The inner array elements are combined with AND logic.
	// Example: [[{">", date1}, {"<", date2}], [{"=", date3}]]
	// This translates to: (valid_at > date1 AND valid_at < date2) OR (valid_at = date3)
	ValidAt [][]*DateFilter `json:"valid_at,omitempty" url:"valid_at,omitempty"`
	// contains filtered or unexported fields
}

func (*SearchFilters) GetCreatedAt

func (s *SearchFilters) GetCreatedAt() [][]*DateFilter

func (*SearchFilters) GetEdgeTypes

func (s *SearchFilters) GetEdgeTypes() []string

func (*SearchFilters) GetExpiredAt

func (s *SearchFilters) GetExpiredAt() [][]*DateFilter

func (*SearchFilters) GetExtraProperties

func (s *SearchFilters) GetExtraProperties() map[string]interface{}

func (*SearchFilters) GetInvalidAt

func (s *SearchFilters) GetInvalidAt() [][]*DateFilter

func (*SearchFilters) GetNodeLabels

func (s *SearchFilters) GetNodeLabels() []string

func (*SearchFilters) GetValidAt

func (s *SearchFilters) GetValidAt() [][]*DateFilter

func (*SearchFilters) String

func (s *SearchFilters) String() string

func (*SearchFilters) UnmarshalJSON

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

type SearchScope

type SearchScope = interface{}

type SearchType

type SearchType = interface{}

type Session

type Session = interface{}

type SessionClassification

type SessionClassification = interface{}

type SessionFactRatingExamples

type SessionFactRatingExamples = interface{}

type SessionFactRatingInstruction

type SessionFactRatingInstruction = interface{}

type SessionListResponse

type SessionListResponse = interface{}

type SessionSearchQuery

type SessionSearchQuery = interface{}

type SessionSearchResponse

type SessionSearchResponse = interface{}

type SessionSearchResult

type SessionSearchResult = interface{}

type SuccessResponse

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

func (*SuccessResponse) GetExtraProperties

func (s *SuccessResponse) GetExtraProperties() map[string]interface{}

func (*SuccessResponse) GetMessage

func (s *SuccessResponse) GetMessage() *string

func (*SuccessResponse) String

func (s *SuccessResponse) String() string

func (*SuccessResponse) UnmarshalJSON

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

type Summary

type Summary = interface{}

type SummaryListResponse

type SummaryListResponse = interface{}

type SystemRole

type SystemRole = interface{}

type Thread

type Thread struct {
	CreatedAt   *string `json:"created_at,omitempty" url:"created_at,omitempty"`
	ProjectUUID *string `json:"project_uuid,omitempty" url:"project_uuid,omitempty"`
	ThreadID    *string `json:"thread_id,omitempty" url:"thread_id,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 (*Thread) GetCreatedAt

func (t *Thread) GetCreatedAt() *string

func (*Thread) GetExtraProperties

func (t *Thread) GetExtraProperties() map[string]interface{}

func (*Thread) GetProjectUUID

func (t *Thread) GetProjectUUID() *string

func (*Thread) GetThreadID

func (t *Thread) GetThreadID() *string

func (*Thread) GetUUID

func (t *Thread) GetUUID() *string

func (*Thread) GetUserID

func (t *Thread) GetUserID() *string

func (*Thread) String

func (t *Thread) String() string

func (*Thread) UnmarshalJSON

func (t *Thread) UnmarshalJSON(data []byte) error

type ThreadContextResponse

type ThreadContextResponse struct {
	// Memory context containing relevant facts and entities for the session. Can be put into the prompt directly.
	Context *string `json:"context,omitempty" url:"context,omitempty"`
	// contains filtered or unexported fields
}

func (*ThreadContextResponse) GetContext

func (t *ThreadContextResponse) GetContext() *string

func (*ThreadContextResponse) GetExtraProperties

func (t *ThreadContextResponse) GetExtraProperties() map[string]interface{}

func (*ThreadContextResponse) String

func (t *ThreadContextResponse) String() string

func (*ThreadContextResponse) UnmarshalJSON

func (t *ThreadContextResponse) UnmarshalJSON(data []byte) error

type ThreadGetRequest

type ThreadGetRequest struct {
	// Limit the number of results returned
	Limit *int `json:"-" url:"limit,omitempty"`
	// Cursor for pagination
	Cursor *int `json:"-" url:"cursor,omitempty"`
	// Number of most recent messages to return (overrides limit and cursor)
	Lastn *int `json:"-" url:"lastn,omitempty"`
}

type ThreadGetUserContextRequest

type ThreadGetUserContextRequest struct {
	// The minimum rating by which to filter relevant facts.
	MinRating *float64 `json:"-" url:"minRating,omitempty"`
	// Defaults to summary mode. Use basic for lower latency
	Mode *ThreadGetUserContextRequestMode `json:"-" url:"mode,omitempty"`
}

type ThreadGetUserContextRequestMode

type ThreadGetUserContextRequestMode string
const (
	ThreadGetUserContextRequestModeBasic   ThreadGetUserContextRequestMode = "basic"
	ThreadGetUserContextRequestModeSummary ThreadGetUserContextRequestMode = "summary"
)

func NewThreadGetUserContextRequestModeFromString

func NewThreadGetUserContextRequestModeFromString(s string) (ThreadGetUserContextRequestMode, error)

func (ThreadGetUserContextRequestMode) Ptr

type ThreadListAllRequest

type ThreadListAllRequest struct {
	// Page number for pagination, starting from 1
	PageNumber *int `json:"-" url:"page_number,omitempty"`
	// Number of threads to retrieve per page.
	PageSize *int `json:"-" url:"page_size,omitempty"`
	// Field to order the results by: created_at, updated_at, user_id, thread_id.
	OrderBy *string `json:"-" url:"order_by,omitempty"`
	// Order direction: true for ascending, false for descending.
	Asc *bool `json:"-" url:"asc,omitempty"`
}

type ThreadListResponse

type ThreadListResponse struct {
	ResponseCount *int      `json:"response_count,omitempty" url:"response_count,omitempty"`
	Threads       []*Thread `json:"threads,omitempty" url:"threads,omitempty"`
	TotalCount    *int      `json:"total_count,omitempty" url:"total_count,omitempty"`
	// contains filtered or unexported fields
}

func (*ThreadListResponse) GetExtraProperties

func (t *ThreadListResponse) GetExtraProperties() map[string]interface{}

func (*ThreadListResponse) GetResponseCount

func (t *ThreadListResponse) GetResponseCount() *int

func (*ThreadListResponse) GetThreads

func (t *ThreadListResponse) GetThreads() []*Thread

func (*ThreadListResponse) GetTotalCount

func (t *ThreadListResponse) GetTotalCount() *int

func (*ThreadListResponse) String

func (t *ThreadListResponse) String() string

func (*ThreadListResponse) UnmarshalJSON

func (t *ThreadListResponse) UnmarshalJSON(data []byte) error

type ToolRole

type ToolRole = interface{}

type UpdateDocumentCollectionRequest

type UpdateDocumentCollectionRequest = interface{}

type UpdateDocumentListRequest

type UpdateDocumentListRequest = interface{}

type UpdateDocumentRequest

type UpdateDocumentRequest = interface{}

type UpdateGraphRequest

type UpdateGraphRequest struct {
	Description           *string                `json:"description,omitempty" url:"-"`
	FactRatingInstruction *FactRatingInstruction `json:"fact_rating_instruction,omitempty" url:"-"`
	Name                  *string                `json:"name,omitempty" url:"-"`
}

type UpdateGroupRequest

type UpdateGroupRequest = interface{}

type UpdateSessionRequest

type UpdateSessionRequest = interface{}

type UpdateUserRequest

type UpdateUserRequest struct {
	// The email address of the user.
	Email *string `json:"email,omitempty" url:"-"`
	// Optional instruction to use for fact rating.
	FactRatingInstruction *FactRatingInstruction `json:"fact_rating_instruction,omitempty" url:"-"`
	// The first name of the user.
	FirstName *string `json:"first_name,omitempty" url:"-"`
	// The last name of the user.
	LastName *string `json:"last_name,omitempty" url:"-"`
	// The metadata to update
	Metadata map[string]interface{} `json:"metadata,omitempty" url:"-"`
}

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"`
	FactRatingInstruction *ModelsFactRatingInstruction `json:"fact_rating_instruction,omitempty" url:"fact_rating_instruction,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"`
	// Deprecated
	Metadata    map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
	ProjectUUID *string                `json:"project_uuid,omitempty" url:"project_uuid,omitempty"`
	// Deprecated
	SessionCount *int `json:"session_count,omitempty" url:"session_count,omitempty"`
	// Deprecated
	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) GetCreatedAt

func (u *User) GetCreatedAt() *string

func (*User) GetDeletedAt

func (u *User) GetDeletedAt() *string

func (*User) GetEmail

func (u *User) GetEmail() *string

func (*User) GetExtraProperties

func (u *User) GetExtraProperties() map[string]interface{}

func (*User) GetFactRatingInstruction

func (u *User) GetFactRatingInstruction() *ModelsFactRatingInstruction

func (*User) GetFirstName

func (u *User) GetFirstName() *string

func (*User) GetID

func (u *User) GetID() *int

func (*User) GetLastName

func (u *User) GetLastName() *string

func (*User) GetMetadata

func (u *User) GetMetadata() map[string]interface{}

func (*User) GetProjectUUID

func (u *User) GetProjectUUID() *string

func (*User) GetSessionCount

func (u *User) GetSessionCount() *int

func (*User) GetUUID

func (u *User) GetUUID() *string

func (*User) GetUpdatedAt

func (u *User) GetUpdatedAt() *string

func (*User) GetUserID

func (u *User) GetUserID() *string

func (*User) String

func (u *User) String() string

func (*User) UnmarshalJSON

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

type UserListOrderedRequest

type UserListOrderedRequest 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"`
}

type UserListResponse

type UserListResponse struct {
	RowCount   *int    `json:"row_count,omitempty" url:"row_count,omitempty"`
	TotalCount *int    `json:"total_count,omitempty" url:"total_count,omitempty"`
	Users      []*User `json:"users,omitempty" url:"users,omitempty"`
	// contains filtered or unexported fields
}

func (*UserListResponse) GetExtraProperties

func (u *UserListResponse) GetExtraProperties() map[string]interface{}

func (*UserListResponse) GetRowCount

func (u *UserListResponse) GetRowCount() *int

func (*UserListResponse) GetTotalCount

func (u *UserListResponse) GetTotalCount() *int

func (*UserListResponse) GetUsers

func (u *UserListResponse) GetUsers() []*User

func (*UserListResponse) String

func (u *UserListResponse) String() string

func (*UserListResponse) UnmarshalJSON

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

type UserNodeResponse

type UserNodeResponse struct {
	Node *EntityNode `json:"node,omitempty" url:"node,omitempty"`
	// contains filtered or unexported fields
}

func (*UserNodeResponse) GetExtraProperties

func (u *UserNodeResponse) GetExtraProperties() map[string]interface{}

func (*UserNodeResponse) GetNode

func (u *UserNodeResponse) GetNode() *EntityNode

func (*UserNodeResponse) String

func (u *UserNodeResponse) String() string

func (*UserNodeResponse) UnmarshalJSON

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

type UserRole

type UserRole = interface{}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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