genkitx-github
    Preparing search index...

    Function defineGithubModel

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

      Parameters

      • name: string

        The name of the model (e.g., "gpt-4-turbo", "custom-model")

      • Optionaloptions: PluginOptions

        Plugin options including githubToken, endpoint, and apiVersion

      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 { defineGithubModel } from 'genkitx-github';

      const customModel = defineGithubModel('my-custom-model', {
      githubToken: process.env.GITHUB_TOKEN
      });

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