Skip to content

Commit

Permalink
fix merge conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
alexguo247 committed Jan 4, 2022
2 parents 3a8cd74 + 0447882 commit 2896239
Show file tree
Hide file tree
Showing 4 changed files with 0 additions and 50 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ For a full breakdown of endpoints and arguments, please consult the [Cohere Docs
Cohere Endpoint | Function
----- | -----
/generate | co.Generate()
/similarity | co.Similarity()
/choose-best | co.ChooseBest()
/embed | co.Embed()
/likelihood | co.Likelihood()
Expand Down
17 changes: 0 additions & 17 deletions client.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ type Client struct {

const (
endpointGenerate = "generate"
endpointSimilarity = "similarity"
endpointChooseBest = "choose-best"
endpointEmbed = "embed"
endpointLikelihood = "likelihood"
Expand Down Expand Up @@ -151,22 +150,6 @@ func (c *Client) Generate(model string, opts GenerateOptions) (*GenerateResponse
return ret, nil
}

// Uses embeddings to measure the semantic similarity between a text `anchor` and its `targets`.
// See: https://docs.cohere.ai/similarity-reference
// Returns a SimilarityResponse object.
func (c *Client) Similarity(model string, opts SimilarityOptions) (*SimilarityResponse, error) {
res, err := c.post(model, endpointSimilarity, opts)
if err != nil {
return nil, err
}

ret := &SimilarityResponse{}
if err := json.Unmarshal(res, ret); err != nil {
return nil, err
}
return ret, nil
}

// Uses likelihood to perform classification. Given a query text that you'd like to classify between
// a number of options, Choose Best will return a score between the query and each option.
// See: https://docs.cohere.ai/choose-best-reference
Expand Down
17 changes: 0 additions & 17 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,23 +60,6 @@ func TestGenerate(t *testing.T) {
})
}

func TestSimilarity(t *testing.T) {
co, err := CreateClient(apiKey)
if err != nil {
t.Error(err)
}

t.Run("Similarity", func(t *testing.T) {
_, err := co.Similarity("small", SimilarityOptions{
Anchor: "hi how are you doing today?",
Targets: []string{"greeting", "request for assistance", "asking a question"},
})
if err != nil {
t.Errorf("expected result, got error: %s", err.Error())
}
})
}

func TestChooseBest(t *testing.T) {
co, err := CreateClient(apiKey)
if err != nil {
Expand Down
15 changes: 0 additions & 15 deletions similarity.go

This file was deleted.

0 comments on commit 2896239

Please sign in to comment.