Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Clean up doc strings #265

Merged
merged 2 commits into from
May 29, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion go/plugins/googleai/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ func (e *embedder) Embed(ctx context.Context, input *ai.EmbedRequest) ([]float32
return res.Embedding.Values, nil
}

// NewEmbedder returns an embedder which can compute the embedding
// NewEmbedder returns an [ai.Embedder] that can compute the embedding
// of an input document given the Google AI model.
func NewEmbedder(ctx context.Context, model, apiKey string) (ai.Embedder, error) {
client, err := newClient(ctx, apiKey)
Expand Down
4 changes: 2 additions & 2 deletions go/plugins/googleai/googleai.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ func translateResponse(resp *genai.GenerateContentResponse) *ai.GenerateResponse
return r
}

// NewGenerator returns an action which sends a request to
// NewGenerator returns an [ai.Generator] which sends a request to
// the google AI model and returns the response.
func NewGenerator(ctx context.Context, model, apiKey string) (ai.Generator, error) {
client, err := newClient(ctx, apiKey)
Expand All @@ -201,7 +201,7 @@ func NewGenerator(ctx context.Context, model, apiKey string) (ai.Generator, erro
}, nil
}

// Init registers all the actions in this package with ai.
// Init registers all the actions in this package with [ai]'s Register calls.
func Init(ctx context.Context, model, apiKey string) error {
e, err := NewEmbedder(ctx, model, apiKey)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion go/plugins/pinecone/genkit.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ import (
// documents in pinecone.
const defaultTextKey = "_content"

// Init registers actions to be used with ai.
// Init registers all the actions in this package with [ai]'s Register calls.
//
// apiKey is the API key to use to access Pinecone.
// If it is the empty string, it is read from the PINECONE_API_INDEX
Expand Down
4 changes: 2 additions & 2 deletions go/plugins/vertexai/embed.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ type embedder struct {
client *aiplatform.PredictionClient
}

// EmbedOptions is options for the Vertex AI embedder.
// Set [ai.EmbedRequest].Options to a value of type &EmbedOptions.
// EmbedOptions are options for the Vertex AI embedder.
// Set [ai.EmbedRequest.Options] to a value of type *[EmbedOptions].
type EmbedOptions struct {
// Document title.
Title string `json:"title,omitempty"`
Expand Down
4 changes: 2 additions & 2 deletions go/plugins/vertexai/vertexai.go
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ func translateResponse(resp *genai.GenerateContentResponse) *ai.GenerateResponse
return r
}

// NewGenerator returns an action which sends a request to
// NewGenerator returns an [ai.Generator] which sends a request to
// the vertex AI model and returns the response.
func NewGenerator(ctx context.Context, model, projectID, location string) (ai.Generator, error) {
client, err := newClient(ctx, projectID, location)
Expand All @@ -174,7 +174,7 @@ func NewGenerator(ctx context.Context, model, projectID, location string) (ai.Ge
}, nil
}

// Init registers all the actions in this package with ai.
// Init registers all the actions in this package with [ai]'s Register calls.
func Init(ctx context.Context, model, projectID, location string) error {
g, err := NewGenerator(ctx, model, projectID, location)
if err != nil {
Expand Down
Loading