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

feat: [Go] simple request helpers #488

Merged
merged 16 commits into from
Jun 26, 2024
Merged

feat: [Go] simple request helpers #488

merged 16 commits into from
Jun 26, 2024

Conversation

pavelgj
Copy link
Collaborator

@pavelgj pavelgj commented Jun 26, 2024

  model.Generate(context.Background(), ai.NewUserTextGenerateRequest("tell me about bananas"), nil)

  model.Generate(
        context.Background(),
        ai.NewGenerateRequest(
            map[string]any{"temparature": 1},
            ai.NewSystemTextMessage("talk like a pirate"),
            ai.NewUserMessage(ai.NewMediaPart("image/png", img)),
            ai.NewModelTextMessage("This looks nice yarrr"),
            ai.NewUserTextMessage("tell me more....")),
        nil)

@pavelgj pavelgj changed the title feat: [Go] PROPOSAL: simple request builder feat: [Go] PROPOSAL: simple request helpers Jun 26, 2024
go/ai/request_helpers.go Outdated Show resolved Hide resolved
go/ai/request_helpers.go Outdated Show resolved Hide resolved
go/ai/request_helpers.go Outdated Show resolved Hide resolved
pavelgj and others added 3 commits June 26, 2024 13:21
Co-authored-by: Alex Pascal <apascal07@gmail.com>
Co-authored-by: Alex Pascal <apascal07@gmail.com>
Co-authored-by: Alex Pascal <apascal07@gmail.com>
go/ai/request_helpers.go Outdated Show resolved Hide resolved
go/ai/request_helpers.go Show resolved Hide resolved
go/ai/request_helpers.go Show resolved Hide resolved
go/ai/request_helpers.go Outdated Show resolved Hide resolved
go/ai/request_helpers.go Show resolved Hide resolved
pavelgj and others added 5 commits June 26, 2024 13:24
Co-authored-by: Alex Pascal <apascal07@gmail.com>
Co-authored-by: Alex Pascal <apascal07@gmail.com>
Co-authored-by: Alex Pascal <apascal07@gmail.com>
Co-authored-by: Alex Pascal <apascal07@gmail.com>
Co-authored-by: Alex Pascal <apascal07@gmail.com>
@pavelgj pavelgj marked this pull request as ready for review June 26, 2024 17:33
@apascal07
Copy link
Collaborator

Remove the helper I added yesterday and update the init sample please.

@pavelgj pavelgj changed the title feat: [Go] PROPOSAL: simple request helpers feat: [Go] simple request helpers Jun 26, 2024
@pavelgj
Copy link
Collaborator Author

pavelgj commented Jun 26, 2024

Remove the helper I added yesterday and update the init sample please.

which one did you add?

@apascal07
Copy link
Collaborator

Remove the helper I added yesterday and update the init sample please.

which one did you add?

func NewTextMessages(r Role, m string) []*Message {

@pavelgj
Copy link
Collaborator Author

pavelgj commented Jun 26, 2024

Remove the helper I added yesterday and update the init sample please.

which one did you add?

func NewTextMessages(r Role, m string) []*Message {

Ah... done.

@pavelgj pavelgj merged commit e63cb50 into main Jun 26, 2024
4 of 5 checks passed
@pavelgj pavelgj deleted the pj/goRequestBuilder branch June 26, 2024 18:31
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.

3 participants