MCPcopy Create free account
hub / github.com/InferCore/InferCore / extractOutputText

Function extractOutputText

internal/adapters/bedrock/bedrock.go:98–120  ·  view source on GitHub ↗
(out *bedrockruntime.ConverseOutput)

Source from the content-addressed store, hash-verified

96}
97
98func extractOutputText(out *bedrockruntime.ConverseOutput) string {
99 if out == nil || out.Output == nil {
100 return ""
101 }
102 var msg *brtypes.Message
103 switch v := out.Output.(type) {
104 case *brtypes.ConverseOutputMemberMessage:
105 msg = &v.Value
106 default:
107 return ""
108 }
109 if msg == nil {
110 return ""
111 }
112 var b strings.Builder
113 for _, block := range msg.Content {
114 switch v := block.(type) {
115 case *brtypes.ContentBlockMemberText:
116 b.WriteString(v.Value)
117 }
118 }
119 return b.String()
120}
121
122func (a *Adapter) Health(ctx context.Context) error {
123 if a.region == "" {

Callers 1

InvokeMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected