Documentation
¶
Index ¶
- Constants
- Variables
- func NewInferenceRole(scope constructs.Construct, id *string, props *RoleProps) awsiam.Role
- type Bedrock
- type Client
- type FileSystem
- type Job
- func (job *Job) Cancel() error
- func (w Job) Close() error
- func (job *Job) Commit() (string, error)
- func (job *Job) ID() string
- func (w Job) Prompt(ctx context.Context, prompt []fmt.Stringer, opts ...chatter.Opt) (chatter.Reply, error)
- func (w Job) UsedInputTokens() int
- func (w Job) UsedReplyTokens() int
- type Option
- type RoleProps
Constants ¶
View Source
const Version = "bedrockbatch/v0.1.0"
Variables ¶
View Source
var ( // The Amazon Resource Name (ARN) of the service role with permissions to carry // out and manage batch inference. // // This option is required. // // [See AWS documentation]: https://docs.aws.amazon.com/bedrock/latest/userguide/batch-iam-sr.html WithRole = opts.ForName[Client, string]("role") // Set AWS S3 bucket for input/output data // // This option is required. WithBucket = opts.ForName[Client, string]("bucket") // Set AWS Bedrock Foundational LLM // // This option is required. WithLLM = opts.ForType[Client, bedrockapi.LLM]() // Use aws.Config to config the client WithConfig = opts.FMap(optsFromConfig) // Use region for aws.Config WithRegion = opts.FMap(optsFromRegion) // Set us-west-2 as default region WithDefaultRegion = WithRegion("us-west-2") // Set file system client WithFileSystem = opts.ForType[Client, FileSystem]() // Set batch inference client WithBedrock = opts.ForType[Client, Bedrock]() )
Functions ¶
Types ¶
type Bedrock ¶
type Bedrock interface {
CreateModelInvocationJob(ctx context.Context, params *bedrock.CreateModelInvocationJobInput, optFns ...func(*bedrock.Options)) (*bedrock.CreateModelInvocationJobOutput, error)
}
AWS Bedrock API used by the client for batch inference
type FileSystem ¶
File System API used by the client for S3 I/O
type Job ¶
type Job struct {
// contains filtered or unexported fields
}
func (Job) UsedInputTokens ¶
func (w Job) UsedInputTokens() int
func (Job) UsedReplyTokens ¶
func (w Job) UsedReplyTokens() int
Click to show internal directories.
Click to hide internal directories.