diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 422b29c..5292715 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -27,17 +27,6 @@ jobs: uses: borales/actions-yarn@v5 with: cmd: install --frozen-lockfile - - name: 'Setup jq' - uses: dcarbone/install-jq-action@v2 - with: - version: '1.7' - force: 'true' - - name: 'Set type module' - run: | - which jq - jq --version - tmp=$(mktemp) - jq '.type = "module"' package.json > "$tmp" && mv "$tmp" package.json - name: lint uses: borales/actions-yarn@v5 with: diff --git a/eslint.config.js b/eslint.config.js index e8b7f78..cb6d178 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -1,9 +1,9 @@ -import globals from "globals"; -import pluginJs from "@eslint/js"; -import tseslint from "typescript-eslint"; +const globals = require("globals"); +const pluginJs = require("@eslint/js"); +const tseslint = require("typescript-eslint"); -export default [ +module.exports = [ {files: ["**/*.{js,mjs,cjs,ts}"]}, {languageOptions: { globals: globals.node }}, pluginJs.configs.recommended, diff --git a/src/github_llms.ts b/src/github_llms.ts index af4c23d..d2cdba2 100644 --- a/src/github_llms.ts +++ b/src/github_llms.ts @@ -696,13 +696,14 @@ function fromGithubChoice( : "other", message: { role: "model", - content: (toolRequestParts?.length ?? 0) > 0 - ? (toolRequestParts as ToolRequestPart[]) - : [ - jsonMode - ? { data: JSON.parse(choice.message.content!) } - : { text: choice.message.content! }, - ], + content: + (toolRequestParts?.length ?? 0) > 0 + ? (toolRequestParts as ToolRequestPart[]) + : [ + jsonMode + ? { data: JSON.parse(choice.message.content!) } + : { text: choice.message.content! }, + ], }, custom: {}, }; @@ -756,7 +757,9 @@ export function toGithubRequestBody( `${response_format} format is not supported for GPT models currently`, ); } - const modelString = (request.config?.version || model.version || modelName) as string; + const modelString = (request.config?.version || + model.version || + modelName) as string; const body = { body: { messages: githubMessages, diff --git a/src/index.ts b/src/index.ts index 4232d19..e4aa996 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,7 +1,13 @@ import { genkitPlugin, Plugin } from "@genkit-ai/core"; import ModelClient from "@azure-rest/ai-inference"; import { AzureKeyCredential } from "@azure/core-auth"; -import { microsoftPhi35MoE128kInstruct, cohereCommandR082024, cohereCommandRPlus082024, metaLlama3211bVisionInstruct, metaLlama3290bVisionInstruct } from './github_llms'; +import { + microsoftPhi35MoE128kInstruct, + cohereCommandR082024, + cohereCommandRPlus082024, + metaLlama3211bVisionInstruct, + metaLlama3290bVisionInstruct, +} from "./github_llms"; import { githubModel, openAIGpt4o, @@ -66,7 +72,7 @@ export { microsoftPhi3Small128kInstruct, microsoftPhi3Medium4kInstruct, microsoftPhi35Mini128kInstruct, - microsoftPhi35MoE128kInstruct + microsoftPhi35MoE128kInstruct, }; export {