Skip to content

Conversation

@jba
Copy link
Contributor

@jba jba commented Jun 10, 2024

Init returns the models and embedders that it defines.

Users can access defined actions in one of three ways: by slice index,
by calling Action.Name on a slice element, or by calling
the Model or Embedder functions.

Init returns the models and embedders that it defines.

Users can access defined actions in one of three ways: by slice index,
by calling Action.Name on a slice element, or by calling
the Model or Embedder functions.
@jba jba marked this pull request as draft June 10, 2024 16:02
}

func Init(ctx context.Context, cfg Config) (err error) {
// Init initializes the plugin.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/the/this/

os.Exit(1)
}
err := googleai.Init(context.Background(), googleai.Config{APIKey: apiKey})
_, _, err := googleai.Init(context.Background(), googleai.Config{APIKey: apiKey})
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to understand, we could do instead here:

gs, _, err := googleai.Init(context.Background(), googleai.Config{APIKey: apiKey, Models: []string{"gemini-1.5-pro"}})
g := gs[0]

?

It seems weird to me that the empty list means "initialize them all". In the call above, the plugin will initialize all the embedders because we didn't specify, and didn't need, any embedders. Maybe there is a more explicit way to say "all"? config.Models == []string{"*"}?
(Fine to tackle in a separate CL.)

A sample demonstrating how to use Postgres's vector extension
to build an indexer and retriever.
@jba
Copy link
Contributor Author

jba commented Jun 10, 2024

Abandoning this in favor of #379.

@jba jba closed this Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants