Skip to content

Commit

Permalink
SDK regeneration
Browse files Browse the repository at this point in the history
  • Loading branch information
fern-api[bot] committed Jun 12, 2024
1 parent 86f9cd7 commit 2d990c1
Show file tree
Hide file tree
Showing 5 changed files with 330 additions and 94 deletions.
2 changes: 1 addition & 1 deletion core/request_option.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ func (r *RequestOptions) cloneHeader() http.Header {
headers := r.HTTPHeader.Clone()
headers.Set("X-Fern-Language", "Go")
headers.Set("X-Fern-SDK-Name", "github.com/getzep/zep-go")
headers.Set("X-Fern-SDK-Version", "v1.0.3")
headers.Set("X-Fern-SDK-Version", "v1.0.4")
return headers
}

Expand Down
24 changes: 24 additions & 0 deletions errors.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,30 @@ func (b *BadRequestError) Unwrap() error {
return b.APIError
}

// Conflict
type ConflictError struct {
*core.APIError
Body *APIError
}

func (c *ConflictError) UnmarshalJSON(data []byte) error {
var body *APIError
if err := json.Unmarshal(data, &body); err != nil {
return err
}
c.StatusCode = 409
c.Body = body
return nil
}

func (c *ConflictError) MarshalJSON() ([]byte, error) {
return json.Marshal(c.Body)
}

func (c *ConflictError) Unwrap() error {
return c.APIError
}

// Internal Server Error
type InternalServerError struct {
*core.APIError
Expand Down
37 changes: 20 additions & 17 deletions memory.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,14 @@ type CreateSessionRequest struct {
UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
}

type ClassifySessionRequest struct {
// The classes to use for classification.
Classes []string `json:"classes,omitempty" url:"classes,omitempty"`
// Custom instruction to use for classification.
Instruction *string `json:"instruction,omitempty" url:"instruction,omitempty"`
// The number of session messages to consider for classification. Defaults to 4.
LastN *int `json:"last_n,omitempty" url:"last_n,omitempty"`
// The name of the classifier. Will be used to store the classification in session metadata if persist is True.
Name string `json:"name" url:"name"`
// Whether to persist the classification to session metadata. Defaults to True.
Persist *bool `json:"persist,omitempty" url:"persist,omitempty"`
}

type EndSessionRequest struct {
Instruction *string `json:"instruction,omitempty" url:"instruction,omitempty"`
Classify *ClassifySessionRequest `json:"classify,omitempty" url:"classify,omitempty"`
Instruction *string `json:"instruction,omitempty" url:"instruction,omitempty"`
}

type ModelsExtractDataRequest struct {
LastNMessages *int `json:"last_n_messages,omitempty" url:"last_n_messages,omitempty"`
ZepDataClasses []*ModelsZepDataClass `json:"zep_data_classes,omitempty" url:"zep_data_classes,omitempty"`
type EndSessionsRequest struct {
Instruction *string `json:"instruction,omitempty" url:"instruction,omitempty"`
SessionIDs []string `json:"session_ids,omitempty" url:"session_ids,omitempty"`
}

type MemoryGetRequest struct {
Expand Down Expand Up @@ -83,6 +71,21 @@ type MemorySearchPayload struct {
Text *string `json:"text,omitempty" url:"text,omitempty"`
}

type SessionSearchQuery struct {
// The maximum number of search results to return. Defaults to None (no limit).
Limit *int `json:"-" url:"limit,omitempty"`
MinScore *float64 `json:"min_score,omitempty" url:"min_score,omitempty"`
MmrLambda *float64 `json:"mmr_lambda,omitempty" url:"mmr_lambda,omitempty"`
// filter on the metadata
RecordFilter map[string]interface{} `json:"record_filter,omitempty" url:"record_filter,omitempty"`
SearchScope *SearchScope `json:"search_scope,omitempty" url:"search_scope,omitempty"`
SearchType *SearchType `json:"search_type,omitempty" url:"search_type,omitempty"`
// the session ids to search
SessionIDs []string `json:"session_ids,omitempty" url:"session_ids,omitempty"`
Text *string `json:"text,omitempty" url:"text,omitempty"`
UserID *string `json:"user_id,omitempty" url:"user_id,omitempty"`
}

type MemorySynthesizeQuestionRequest struct {
// The number of messages to use for question synthesis.
LastNMessages *int `json:"-" url:"lastNMessages,omitempty"`
Expand Down
Loading

0 comments on commit 2d990c1

Please sign in to comment.