Documentation ¶
Index ¶
- func GetModels() []string
- func PromptModel(prompt string, temp float32, top_p float32, max_len int) string
- func PromptModelStream(prompt string, temp float32, top_p float32, max_len int) (*bedrockruntime.InvokeModelWithResponseStreamOutput, error)
- func StartChatSession()
- type Generation
- type Models
- type StreamingOutputHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func PromptModelStream ¶
func PromptModelStream(prompt string, temp float32, top_p float32, max_len int) (*bedrockruntime.InvokeModelWithResponseStreamOutput, error)
func StartChatSession ¶
func StartChatSession()
Types ¶
type Generation ¶
type Generation struct { Generation string `json:"generation"` PromptTokenCount int `json:"prompt_token_count"` GenerationTokenCount int `json:"generation_token_count"` StopReason string `json:"stop_reason"` }
func ProcessStreamingOutput ¶
func ProcessStreamingOutput(output *bedrockruntime.InvokeModelWithResponseStreamOutput, handler StreamingOutputHandler) (Generation, error)
type StreamingOutputHandler ¶
type StreamingOutputHandler func(ctx context.Context, part Generation) error
Click to show internal directories.
Click to hide internal directories.