From 26695c631108e70aeb93c0cf226d9888193abc9f Mon Sep 17 00:00:00 2001 From: fern-api <115122769+fern-api[bot]@users.noreply.github.com> Date: Wed, 19 Jun 2024 18:37:22 +0000 Subject: [PATCH] SDK regeneration --- memory.go | 31 +------------------------------ types.go | 25 +++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 30 deletions(-) diff --git a/memory.go b/memory.go index 2249560..872d62d 100644 --- a/memory.go +++ b/memory.go @@ -2,10 +2,6 @@ package zep -import ( - fmt "fmt" -) - type AddMemoryRequest struct { // Additional instruction for generating the facts. FactInstruction *string `json:"fact_instruction,omitempty" url:"fact_instruction,omitempty"` @@ -48,7 +44,7 @@ type ExtractDataRequest struct { type MemoryGetRequest struct { // The type of memory to retrieve: perpetual, summary_retriever, or message_window. Defaults to perpetual. - MemoryType *MemoryGetRequestMemoryType `json:"-" url:"memoryType,omitempty"` + MemoryType *MemoryType `json:"-" url:"memoryType,omitempty"` // The number of most recent memory entries to retrieve. Lastn *int `json:"-" url:"lastn,omitempty"` } @@ -103,31 +99,6 @@ type MemorySynthesizeQuestionRequest struct { LastNMessages *int `json:"-" url:"lastNMessages,omitempty"` } -type MemoryGetRequestMemoryType string - -const ( - MemoryGetRequestMemoryTypePerpetual MemoryGetRequestMemoryType = "perpetual" - MemoryGetRequestMemoryTypeSummaryRetriever MemoryGetRequestMemoryType = "summary_retriever" - MemoryGetRequestMemoryTypeMessageWindow MemoryGetRequestMemoryType = "message_window" -) - -func NewMemoryGetRequestMemoryTypeFromString(s string) (MemoryGetRequestMemoryType, error) { - switch s { - case "perpetual": - return MemoryGetRequestMemoryTypePerpetual, nil - case "summary_retriever": - return MemoryGetRequestMemoryTypeSummaryRetriever, nil - case "message_window": - return MemoryGetRequestMemoryTypeMessageWindow, nil - } - var t MemoryGetRequestMemoryType - return "", fmt.Errorf("%s is not a valid %T", s, t) -} - -func (m MemoryGetRequestMemoryType) Ptr() *MemoryGetRequestMemoryType { - return &m -} - type ModelsMessageMetadataUpdate struct { // The metadata to update Metadata map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"` diff --git a/types.go b/types.go index 822d31f..9e3107d 100644 --- a/types.go +++ b/types.go @@ -445,6 +445,31 @@ func (m *MemorySearchResult) String() string { return fmt.Sprintf("%#v", m) } +type MemoryType string + +const ( + MemoryTypePerpetual MemoryType = "perpetual" + MemoryTypeSummaryRetriever MemoryType = "summary_retriever" + MemoryTypeMessageWindow MemoryType = "message_window" +) + +func NewMemoryTypeFromString(s string) (MemoryType, error) { + switch s { + case "perpetual": + return MemoryTypePerpetual, nil + case "summary_retriever": + return MemoryTypeSummaryRetriever, nil + case "message_window": + return MemoryTypeMessageWindow, nil + } + var t MemoryType + return "", fmt.Errorf("%s is not a valid %T", s, t) +} + +func (m MemoryType) Ptr() *MemoryType { + return &m +} + type Message struct { // The content of the message. Content *string `json:"content,omitempty" url:"content,omitempty"`