-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
52ce576
commit 2d6a997
Showing
50 changed files
with
5,219 additions
and
2,308 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
# Specify files that shouldn't be modified by Fern |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 ./... |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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...), | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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")) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"` | ||
} |
Oops, something went wrong.