[Enhancement]: Add Amazon Nova Converse API example for Go SDK v2 (bedrock-runtime)

Aperta
#7,812 2 commenti 0 reazioni 1 assegnatario Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@rlhagerm ci sta già lavorando.

Dal 20/4/2026.

Valutazione

Questa issue non è ancora stata valutata.

Descrizione

New example request
Background story

Hello, AWS team. 👋🏻

Currently, the Go SDK v2 gov2/bedrock-runtime only includes a converse api example for claude. Adding the Amazon Nova example will bring Go into parity with the other SDKs and make it much easier for devs to start building with Amazon Nova.

What does this example accomplish?

I would like to provide a PR demonstrating amazon.nova-lite-v1:0 via Bedrock's converse API using the Go v2 SDK, and return the model's text response. The update includes the core action method, unit tests, scenario integration, and metadata.

Which AWS service(s)?

AWS bedrock runtime - Converse API.

Which AWS SDKs or tools?
  • All languages
  • .NET
  • C++
  • Go (v2)
  • Java
  • Java (v2)
  • JavaScript
  • JavaScript (v3)
  • Kotlin
  • PHP
  • Python
  • Ruby
  • Rust
  • Swift
  • Not applicable
Are there existing code examples to leverage?

sources and samples:

Do you have any reference code?
func (wrapper ConverseWrapper) ConverseNova(ctx context.Context, prompt string) (string, error) {  
    var content = types.ContentBlockMemberText{  
        Value: prompt,  
    }  
    var message = types.Message{  
        Content: []types.ContentBlock{&content},  
        Role:    "user",  
    }  
    modelId := "amazon.nova-lite-v1:0"  
    var converseInput = bedrockruntime.ConverseInput{  
        ModelId:  aws.String(modelId),  
        Messages: []types.Message{message},  
    }  
    response, err := wrapper.BedrockRuntimeClient.Converse(ctx, &converseInput)  
    if err != nil {  
        ProcessError(err, modelId)  
    }  
  
    responseText, _ := response.Output.(*types.ConverseOutputMemberMessage)  
    responseContentBlock := responseText.Value.Content[0]  
    text, _ := responseContentBlock.(*types.ContentBlockMemberText)  
    return text.Value, nil  
}
Lingua principale
Java
Stelle
10.5k
Fork
5.8k
Merge medio
2g 21h
PR unite (30g)
30

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di awsdocs/aws-doc-sdk-examples

Tutte le issue di awsdocs/aws-doc-sdk-examples

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.