genkitx-aws-bedrock
    Preparing search index...

    Function defineAwsBedrockModel

    • Defines a custom AWS Bedrock model that is not exported by the plugin

      Parameters

      • name: string

        The name of the model (e.g., "custom.my-model-v1:0")

      • Optionaloptions: PluginOptions

        Plugin options including AWS credentials and region

      Returns ModelAction<
          ZodObject<
              {
                  maxOutputTokens: ZodOptional<ZodNumber>;
                  stopSequences: ZodOptional<ZodArray<ZodString, "many">>;
                  temperature: ZodOptional<ZodNumber>;
                  topK: ZodOptional<ZodNumber>;
                  topP: ZodOptional<ZodNumber>;
                  version: ZodOptional<ZodString>;
              },
              "passthrough",
              ZodTypeAny,
              objectOutputType<
                  {
                      maxOutputTokens: ZodOptional<ZodNumber>;
                      stopSequences: ZodOptional<ZodArray<ZodString, "many">>;
                      temperature: ZodOptional<ZodNumber>;
                      topK: ZodOptional<ZodNumber>;
                      topP: ZodOptional<ZodNumber>;
                      version: ZodOptional<ZodString>;
                  },
                  ZodTypeAny,
                  "passthrough",
              >,
              objectInputType<
                  {
                      maxOutputTokens: ZodOptional<ZodNumber>;
                      stopSequences: ZodOptional<ZodArray<ZodString, "many">>;
                      temperature: ZodOptional<ZodNumber>;
                      topK: ZodOptional<ZodNumber>;
                      topP: ZodOptional<ZodNumber>;
                      version: ZodOptional<ZodString>;
                  },
                  ZodTypeAny,
                  "passthrough",
              >,
          >,
      >

      A ModelAction that can be used with Genkit

      import { defineAwsBedrockModel } from 'genkitx-aws-bedrock';

      const customModel = defineAwsBedrockModel('custom.my-model-v1:0', {
      region: 'us-east-1'
      });

      const response = await ai.generate({
      model: customModel,
      prompt: 'Hello!'
      });