Skip to content

Commit

Permalink
Merge pull request #4 from sgomez/workspaces
Browse files Browse the repository at this point in the history
Create workspaces
  • Loading branch information
sgomez committed May 17, 2024
2 parents 1b182ac + e738ee9 commit fbff767
Show file tree
Hide file tree
Showing 64 changed files with 2,538 additions and 88 deletions.
11 changes: 10 additions & 1 deletion .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"unused-imports"
],
"root": true,
"ignorePatterns": "**/dist/*",
"rules": {
"@typescript-eslint/no-shadow": "error",
"@typescript-eslint/no-unused-vars": [
Expand All @@ -35,5 +36,13 @@
"unicorn/no-null": "off",
"unicorn/no-array-reduce": "off",
"unused-imports/no-unused-imports": "error"
}
},
"overrides": [
{
"files": "examples/**/*.ts",
"rules": {
"unicorn/prefer-top-level-await": "off"
}
}
]
}
2 changes: 1 addition & 1 deletion .lintstagedrc.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { relative } from 'path'

const buildEslintCommand = (filenames) =>
`pnpm lint --fix ${filenames
`pnpm eslint --fix ${filenames
.map((f) => relative(process.cwd(), f))
.join(' ')}`

Expand Down
9 changes: 9 additions & 0 deletions examples/NOTICE
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
This folder includes adapted examples from https://github.com/vercel/ai, which is licensed under the Apache License, Version 2.0.

You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

You may obtain the original code at

https://github.com/vercel/ai
16 changes: 16 additions & 0 deletions examples/ai-core/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Basic Examples

## Usage

1. Run the following commands from the root directory of the repo:
```sh
pnpm install
```
2. Run any example (from the `examples/ai-core` directory) with the following command:
```sh
src/path/to/example.ts
```
3. You can specify the model with the `-m` flag:
```sh
src/path/to/example.ts -m llama3
```
Binary file added examples/ai-core/data/comic-cat.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
20 changes: 20 additions & 0 deletions examples/ai-core/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "ollama-ai-provider-core-examples",
"version": "0.0.0",
"private": true,
"scripts": {},
"dependencies": {
"ai": "latest",
"commander": "^12.0.0",
"ollama-ai-provider": "workspace:latest",
"zod": "3.22.4",
"zod-to-json-schema": "3.22.4"
},
"devDependencies": {
"@types/json-schema": "^7.0.15",
"@types/node": "20.11.20",
"json-schema": "^0.4.0",
"tsx": "4.7.1",
"typescript": "5.1.3"
}
}
Loading

0 comments on commit fbff767

Please sign in to comment.