genkitx-azure-openai
Version:
Genkit AI framework plugin for Azure OpenAI APIs.
1 lines • 4.4 kB
Source Map (JSON)
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["/**\n * Copyright 2026 Xavier Portilla Edo\n * Copyright 2026 Google LLC\n * Copyright 2026 Bloom Inc.\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport type { Genkit } from \"genkit\";\nimport { genkitPlugin } from \"genkit/plugin\";\nimport { AzureOpenAI } from \"openai\";\n\nimport { dallE3, dallE3Model } from \"./dalle.js\";\nimport { whisper1, whisper1Model } from \"./whisper.js\";\n\nimport {\n openaiEmbedder,\n SUPPORTED_EMBEDDING_MODELS,\n textEmbedding3Large,\n textEmbedding3Small,\n textEmbeddingAda002,\n} from \"./embedder.js\";\nimport {\n gpt35Turbo,\n gpt4,\n gpt41,\n gpt41Mini,\n gpt41Nano,\n o1Preview,\n o1Mini,\n o1,\n gpt4o,\n gpt4oMini,\n o3,\n o3Mini,\n o3Pro,\n o4Mini,\n codexMini,\n gpt45,\n gpt5,\n gpt5Mini,\n gpt5Nano,\n gpt5Chat,\n gpt5Codex,\n gpt5Pro,\n gpt51,\n gpt51Chat,\n gpt51Codex,\n gpt51CodexMini,\n gpt51CodexMax,\n gpt52,\n gpt52Chat,\n gpt52Codex,\n gptOss120b,\n gptOss20b,\n gptModel,\n SUPPORTED_GPT_MODELS,\n} from \"./gpt.js\";\nimport { SUPPORTED_TTS_MODELS, ttsModel, tts1, tts1Hd } from \"./tts.js\";\nimport { AzureClientOptions } from \"openai/azure\";\nexport {\n onCallGenkit,\n requireApiKey,\n requireBearerToken,\n requireHeader,\n allowAll,\n allOf,\n anyOf,\n} from \"./azure_functions.js\";\nexport type {\n CorsOptions,\n AzureFunctionsOptions,\n AzureFunctionsActionContext,\n AzureFunctionsFlowResponse,\n AzureFunctionsHandler,\n CallableAzureFunction,\n FlowResponse,\n FlowErrorResponse,\n FlowRunOptions,\n ApiKeyContext,\n BearerTokenContext,\n} from \"./azure_functions.js\";\nexport {\n dallE3,\n tts1,\n tts1Hd,\n whisper1,\n gpt35Turbo,\n gpt4,\n gpt41,\n gpt41Mini,\n gpt41Nano,\n o1,\n o1Mini,\n o1Preview,\n gpt4o,\n gpt4oMini,\n o3,\n o3Mini,\n o3Pro,\n o4Mini,\n codexMini,\n gpt45,\n gpt5,\n gpt5Mini,\n gpt5Nano,\n gpt5Chat,\n gpt5Codex,\n gpt5Pro,\n gpt51,\n gpt51Chat,\n gpt51Codex,\n gpt51CodexMini,\n gpt51CodexMax,\n gpt52,\n gpt52Chat,\n gpt52Codex,\n gptOss120b,\n gptOss20b,\n textEmbedding3Large,\n textEmbedding3Small,\n textEmbeddingAda002,\n};\n\nexport type PluginOptions = AzureClientOptions;\n\nexport const azureOpenAI = (options?: PluginOptions) =>\n genkitPlugin(\"azure-openai\", async (ai: Genkit) => {\n const client = new AzureOpenAI(options);\n for (const name of Object.keys(SUPPORTED_GPT_MODELS)) {\n gptModel(ai, name, client);\n }\n dallE3Model(ai, client);\n whisper1Model(ai, client);\n for (const name of Object.keys(SUPPORTED_TTS_MODELS)) {\n ttsModel(ai, name, client);\n }\n for (const name of Object.keys(SUPPORTED_EMBEDDING_MODELS)) {\n openaiEmbedder(ai, name, client);\n }\n });\n\nexport default azureOpenAI;\n"],"mappings":"AAmBA,SAAS,oBAAoB;AAC7B,SAAS,mBAAmB;AAE5B,SAAS,QAAQ,mBAAmB;AACpC,SAAS,UAAU,qBAAqB;AAExC;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AACP,SAAS,sBAAsB,UAAU,MAAM,cAAc;AAE7D;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AA0DA,MAAM,cAAc,CAAC,YAC1B,aAAa,gBAAgB,OAAO,OAAe;AACjD,QAAM,SAAS,IAAI,YAAY,OAAO;AACtC,aAAW,QAAQ,OAAO,KAAK,oBAAoB,GAAG;AACpD,aAAS,IAAI,MAAM,MAAM;AAAA,EAC3B;AACA,cAAY,IAAI,MAAM;AACtB,gBAAc,IAAI,MAAM;AACxB,aAAW,QAAQ,OAAO,KAAK,oBAAoB,GAAG;AACpD,aAAS,IAAI,MAAM,MAAM;AAAA,EAC3B;AACA,aAAW,QAAQ,OAAO,KAAK,0BAA0B,GAAG;AAC1D,mBAAe,IAAI,MAAM,MAAM;AAAA,EACjC;AACF,CAAC;AAEH,IAAO,gBAAQ;","names":[]}