Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 21 additions & 15 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,24 +1,30 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/typescript-node
{
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",
"name": "Node.js & TypeScript",
// Or use a Dockerfile or Docker Compose file. More info: https://containers.dev/guide/dockerfile
"image": "mcr.microsoft.com/devcontainers/typescript-node:1-22-bookworm",

// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/joshuanianji/devcontainer-features/mount-pnpm-store:1": {}
}
// Features to add to the dev container. More info: https://containers.dev/features.
"features": {
"ghcr.io/joshuanianji/devcontainer-features/mount-pnpm-store:1": {}
},

// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],
"customizations": {
"vscode": {
"extensions": ["oxc.oxc-vscode"]
}
}

// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",
// Use 'forwardPorts' to make a list of ports inside the container available locally.
// "forwardPorts": [],

// Configure tool-specific properties.
// "customizations": {},
// Use 'postCreateCommand' to run commands after the container is created.
// "postCreateCommand": "yarn install",

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
// Configure tool-specific properties.
// "customizations": {},

// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
3 changes: 2 additions & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[*.{ts}]
[*.{js,json,jsonc,ts,tsx}]
max_line_length = 120
Comment thread
coyotte508 marked this conversation as resolved.
indent_style = tab
indent_size = 2
trim_trailing_whitespace = true
Expand Down
8 changes: 8 additions & 0 deletions .oxfmtrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"$schema": "./node_modules/oxfmt/configuration_schema.json",
"ignorePatterns": [],
"useTabs": true,
"printWidth": 120,
// Because tshy modifies the package.json file, the "exports" subprop
"experimentalSortPackageJson": false
}
9 changes: 0 additions & 9 deletions .prettierrc

This file was deleted.

21 changes: 12 additions & 9 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
{
"editor.defaultFormatter": "esbenp.prettier-vscode",
"editor.defaultFormatter": "oxc.oxc-vscode",
"editor.formatOnSave": true,
"editor.formatOnSaveMode": "file", // tell oxfmt to format the whole file, not only the modified lines
"editor.codeActionsOnSave": {
"source.fixAll": "explicit"
},
"[svelte]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"prettier.configPath": ".prettierrc",
"json.format.enable": false,
"[json]": {
"editor.defaultFormatter": "esbenp.prettier-vscode"
},
"cSpell.words": ["huggingface"],
"deno.enablePaths": ["./e2e/deno"],
"search.exclude": {
"**/dist": true
},
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[jsonc]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
},
"[json]": {
"editor.defaultFormatter": "oxc.oxc-vscode"
}
}
12 changes: 6 additions & 6 deletions e2e/svelte/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "myapp",
"version": "0.0.1",
"private": true,
"packageManager": "pnpm@10.10.0",
"type": "module",
"scripts": {
"dev": "vite dev",
"build": "vite build",
Expand All @@ -11,6 +11,10 @@
"check:watch": "svelte-kit sync && svelte-check --tsconfig ./tsconfig.json --watch",
"test:browser": "vitest run --browser.name=chrome --browser.headless"
},
"dependencies": {
"@huggingface/hub": "*",
"@huggingface/inference": "*"
},
"devDependencies": {
"@sveltejs/adapter-auto": "^3.2.0",
"@sveltejs/kit": "^2.5.9",
Expand All @@ -23,9 +27,5 @@
"vite": "^5.2.11",
"vitest": "^1.6.0"
},
"type": "module",
"dependencies": {
"@huggingface/hub": "*",
"@huggingface/inference": "*"
}
"packageManager": "pnpm@10.10.0"
}
14 changes: 7 additions & 7 deletions e2e/ts/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,19 @@
"name": "ts",
"version": "1.0.0",
"description": "",
"keywords": [],
"license": "ISC",
"author": "",
"main": "index.js",
"scripts": {
"start": "tsc && node ./dist/index.js"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"@huggingface/hub": "*",
"@huggingface/inference": "*"
},
"devDependencies": {
"@types/node": "^18.16.1",
"typescript": "^5.0.4"
},
"dependencies": {
"@huggingface/inference": "*",
"@huggingface/hub": "*"
}
}
6 changes: 3 additions & 3 deletions e2e/yarn/package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
{
"name": "yarn",
"version": "1.0.0",
"main": "index.js",
"license": "MIT",
"main": "index.js",
"dependencies": {
"@huggingface/inference": "*",
"@huggingface/hub": "*"
"@huggingface/hub": "*",
"@huggingface/inference": "*"
}
}
13 changes: 6 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
{
"private": true,
"name": "@huggingface/root",
"private": true,
"license": "MIT",
"packageManager": "pnpm@10.10.0",
"scripts": {
"lint": "eslint --quiet --fix --ext .cjs,.ts .eslintrc.cjs",
"lint:check": "eslint --ext .cjs,.ts .eslintrc.cjs",
"format": "prettier --write package.json .prettierrc .vscode .eslintrc.cjs e2e .github *.md",
"format:check": "prettier --check package.json .prettierrc .vscode .eslintrc.cjs .github *.md",
"format": "oxfmt package.json .vscode .eslintrc.cjs e2e .github *.md .devcontainer .oxfmtrc.json",
"format:check": "oxfmt --check package.json .vscode .eslintrc.cjs .github *.md .devcontainer .oxfmtrc.json",
"check-deps": "tsx scripts/check-deps.ts"
},
"devDependencies": {
Expand All @@ -20,8 +19,7 @@
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-svelte": "^2.30.0",
"npm-run-all": "^4.1.5",
"prettier": "^3.1.0",
"prettier-plugin-svelte": "^3.1.2",
"oxfmt": "^0.26.0",
Comment thread
coyotte508 marked this conversation as resolved.
"semver": "^7.5.0",
"tshy": "^3.0.2",
"tsup": "^6.7.0",
Expand All @@ -30,5 +28,6 @@
"vite": "^5.0.2",
"vitest": "^0.34.6",
"webdriverio": "^8.6.7"
}
},
"packageManager": "pnpm@10.10.0"
}
64 changes: 32 additions & 32 deletions packages/agents/package.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,31 @@
{
"name": "@huggingface/agents",
"packageManager": "pnpm@10.10.0",
"version": "0.0.5",
"description": "Multi-modal agents using Hugging Face's models",
"keywords": [
"agents",
"api",
"client",
"face",
"hugging",
"huggingface"
],
"license": "MIT",
"author": "Hugging Face",
"repository": "https://github.com/huggingface/huggingface.js.git",
"publishConfig": {
"access": "public"
},
"source": "index.ts",
"files": [
"dist",
"index.ts",
"src",
"tsconfig.json"
],
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"browser": {
"./dist/index.js": "./dist/browser/index.js",
"./dist/index.mjs": "./dist/browser/index.mjs"
},
"types": "./dist/index.d.ts",
"exports": {
".": {
Expand All @@ -17,45 +34,28 @@
"import": "./dist/index.mjs"
}
},
"browser": {
"./dist/index.js": "./dist/browser/index.js",
"./dist/index.mjs": "./dist/browser/index.mjs"
},
"engines": {
"node": ">=18"
"publishConfig": {
"access": "public"
},
"source": "index.ts",
"scripts": {
"lint": "eslint --quiet --fix --ext .cjs,.ts .",
"lint:check": "eslint --ext .cjs,.ts .",
"format": "prettier --write .",
"format:check": "prettier --check .",
"format": "oxfmt .",
"format:check": "oxfmt --check .",
"prepublishOnly": "pnpm run build",
"build": "tsup && tsc --emitDeclarationOnly --declaration",
"test": "vitest run",
"test:browser": "vitest run --browser.name=chrome --browser.headless --config vitest-browser.config.mts",
"check": "tsc"
},
"files": [
"src",
"dist",
"index.ts",
"tsconfig.json"
],
"keywords": [
"huggingface",
"agents",
"api",
"client",
"hugging",
"face"
],
"author": "Hugging Face",
"license": "MIT",
"dependencies": {
"@huggingface/inference": "workspace:^"
},
"devDependencies": {
"@types/node": "^18.13.0"
},
"dependencies": {
"@huggingface/inference": "workspace:^"
}
"engines": {
"node": ">=18"
},
"packageManager": "pnpm@10.10.0"
}
2 changes: 1 addition & 1 deletion packages/agents/src/lib/evalBuilder.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function evalBuilder(
tools: Tool[],
files: FileList | undefined,
updateCallback: (message: string, data: undefined | string | Blob) => void,
accessToken?: string
accessToken?: string,
): Promise<() => Promise<void>> {
async function wrapperEval() {
if (files && files.length > 0) {
Expand Down
2 changes: 1 addition & 1 deletion packages/agents/src/lib/generateCode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ export async function generateCode(
prompt: string,
tools: Tool[],
files: FileList | undefined,
llm: (input: string) => Promise<string>
llm: (input: string) => Promise<string>,
): Promise<string> {
const fullprompt = generatePrompt(prompt, [...tools, messageTool], {
image: !!files && files[0].type.startsWith("image"),
Expand Down
2 changes: 1 addition & 1 deletion packages/agents/src/lib/promptGeneration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ user: ${example.prompt}
function:
\`\`\`js
${example.code}
\`\`\``
\`\`\``,
)
.join("\n-------\n");

Expand Down
Loading