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 Mar 11, 2024
1 parent 52ce576 commit 2d6a997
Show file tree
Hide file tree
Showing 50 changed files with 5,219 additions and 2,308 deletions.
1 change: 1 addition & 0 deletions .fernignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Specify files that shouldn't be modified by Fern
27 changes: 27 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: ci

on: [push]

jobs:
compile:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up go
uses: actions/setup-go@v4

- name: Compile
run: go build ./...
test:
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3

- name: Set up go
uses: actions/setup-go@v4

- name: Test
run: go test ./...
2 changes: 0 additions & 2 deletions .gitignore

This file was deleted.

35 changes: 0 additions & 35 deletions Makefile

This file was deleted.

51 changes: 51 additions & 0 deletions client/client.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
// This file was auto-generated by Fern from our API Definition.

package client

import (
collection "github.com/getzep/zep-go/collection"
core "github.com/getzep/zep-go/core"
document "github.com/getzep/zep-go/document"
memory "github.com/getzep/zep-go/memory"
messages "github.com/getzep/zep-go/messages"
option "github.com/getzep/zep-go/option"
search "github.com/getzep/zep-go/search"
session "github.com/getzep/zep-go/session"
user "github.com/getzep/zep-go/user"
http "net/http"
)

type Client struct {
baseURL string
caller *core.Caller
header http.Header

Document *document.Client
Collection *collection.Client
Session *session.Client
Memory *memory.Client
Messages *messages.Client
Search *search.Client
User *user.Client
}

func NewClient(opts ...option.RequestOption) *Client {
options := core.NewRequestOptions(opts...)
return &Client{
baseURL: options.BaseURL,
caller: core.NewCaller(
&core.CallerParams{
Client: options.HTTPClient,
MaxAttempts: options.MaxAttempts,
},
),
header: options.ToHeader(),
Document: document.NewClient(opts...),
Collection: collection.NewClient(opts...),
Session: session.NewClient(opts...),
Memory: memory.NewClient(opts...),
Messages: messages.NewClient(opts...),
Search: search.NewClient(opts...),
User: user.NewClient(opts...),
}
}
45 changes: 45 additions & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// This file was auto-generated by Fern from our API Definition.

package client

import (
option "github.com/getzep/zep-go/option"
assert "github.com/stretchr/testify/assert"
http "net/http"
testing "testing"
time "time"
)

func TestNewClient(t *testing.T) {
t.Run("default", func(t *testing.T) {
c := NewClient()
assert.Empty(t, c.baseURL)
})

t.Run("base url", func(t *testing.T) {
c := NewClient(
option.WithBaseURL("test.co"),
)
assert.Equal(t, "test.co", c.baseURL)
})

t.Run("http client", func(t *testing.T) {
httpClient := &http.Client{
Timeout: 5 * time.Second,
}
c := NewClient(
option.WithHTTPClient(httpClient),
)
assert.Empty(t, c.baseURL)
})

t.Run("http header", func(t *testing.T) {
header := make(http.Header)
header.Set("X-API-Tenancy", "test")
c := NewClient(
option.WithHTTPHeader(header),
)
assert.Empty(t, c.baseURL)
assert.Equal(t, "test", c.header.Get("X-API-Tenancy"))
})
}
22 changes: 22 additions & 0 deletions collection.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// This file was auto-generated by Fern from our API Definition.

package zep

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]map[string]interface{} `json:"metadata,omitempty" url:"metadata,omitempty"`
Name string `json:"name" url:"name"`
}

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

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

0 comments on commit 2d6a997

Please sign in to comment.