kopia lustrzana https://github.com/transitive-bullshit/chatgpt-api
feat: WIP refactor monorepo to packages and turbo
rodzic
7d38087222
commit
12ae58c315
|
@ -13,7 +13,7 @@
|
|||
},
|
||||
"ecmaVersion": "latest",
|
||||
"sourceType": "module",
|
||||
"project": "./tsconfig.json"
|
||||
"project": "./packages/core/tsconfig.json"
|
||||
},
|
||||
"rules": {
|
||||
"@typescript-eslint/no-unused-vars": [
|
||||
|
@ -57,7 +57,7 @@
|
|||
},
|
||||
{
|
||||
// disable process.env for framework source files
|
||||
"files": "src/**/*.ts",
|
||||
"files": "packages/**/src/*.ts",
|
||||
"rules": {
|
||||
"no-process-env": "error"
|
||||
}
|
||||
|
|
|
@ -51,3 +51,5 @@ next-env.d.ts
|
|||
.env.development.local
|
||||
.env.test.local
|
||||
.env.production.local
|
||||
|
||||
.turbo
|
|
@ -4,4 +4,4 @@
|
|||
|
||||
## Notes
|
||||
|
||||
- This directory contains auto-generated documentation created by TypeDoc. It is not intended to be edited manually.
|
||||
- This directory contains auto-generated documentation created by TypeDoc. It is not intended to be edited manually.
|
||||
|
|
|
@ -1,8 +1,6 @@
|
|||
{
|
||||
"name": "agentic-docs",
|
||||
"version": "0.0.0",
|
||||
"private": true,
|
||||
"description": "agentic docs website.",
|
||||
"description": "Agentic docs website",
|
||||
"repository": "transitive-bullshit/agentic",
|
||||
"homepage": "https://agentic.so/docs",
|
||||
"license": "MIT",
|
||||
|
@ -17,9 +15,5 @@
|
|||
"nextra-theme-docs": "^2.8.0",
|
||||
"react": "^18.2.0",
|
||||
"react-dom": "^18.2.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^20.3.1",
|
||||
"typescript": "^5.1.3"
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,2 +1 @@
|
|||
# agentic
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
## Intro
|
||||
|
||||
[Bing Web Search][bing-web-search] provides the ability to comb billions of webpages, images, videos, and news with a single API call. It provides a set of search results that match the query parameters specified in the API request.
|
||||
|
||||
|
||||
## Pre-requisites
|
||||
|
||||
Ensure the following environment variable is set:
|
||||
|
@ -20,7 +20,7 @@ Otherwise, you can pass it in as an argument to the `BingWebSearchClient` constr
|
|||
|
||||

|
||||
|
||||
4. Under the "Select a pricing tier" dropdown, select __F1 (3 Calls per second, 1k Calls per month)__ for the free tier. See [Bing Web Search pricing][bing-web-search-pricing] for more information about the available pricing tiers.
|
||||
3. Under the "Select a pricing tier" dropdown, select **F1 (3 Calls per second, 1k Calls per month)** for the free tier. See [Bing Web Search pricing][bing-web-search-pricing] for more information about the available pricing tiers.
|
||||
|
||||

|
||||
|
||||
|
@ -28,14 +28,13 @@ Otherwise, you can pass it in as an argument to the `BingWebSearchClient` constr
|
|||
|
||||

|
||||
|
||||
2. Once the resource has been deployed, navigate to it and click on the "Keys and Endpoint" link in the left sidebar:
|
||||
5. Once the resource has been deployed, navigate to it and click on the "Keys and Endpoint" link in the left sidebar:
|
||||
|
||||

|
||||
|
||||
3. Click the "Copy to clipboard" button next to the "Key 1" value to copy the API key to your clipboard (or click "Show" to reveal the key and copy it manually). The other key is a backup key that can be used if the first key is revoked or regenerated.
|
||||
6. Click the "Copy to clipboard" button next to the "Key 1" value to copy the API key to your clipboard (or click "Show" to reveal the key and copy it manually). The other key is a backup key that can be used if the first key is revoked or regenerated.
|
||||
|
||||

|
||||
|
||||
[bing-web-search]: https://azure.microsoft.com/en-us/services/cognitive-services/bing-web-search-api
|
||||
|
||||
[bing-web-search-pricing]: https://azure.microsoft.com/en-us/pricing/details/cognitive-services/search-api/web/
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
## Intro
|
||||
|
||||
[Metaphor][metaphor] is an AI-driven search engine platform engineered from the ground up to offer revolutionary internet search experiences.
|
||||
[Metaphor][metaphor] is an AI-driven search engine platform engineered from the ground up to offer revolutionary internet search experiences.
|
||||
|
||||
Through the Metaphor Service, you can interface with Metaphor's powerful AI-enhanced search capabilities, bringing the potential of an intelligent and instant internet search to any Agentic workflow.
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ Otherwise, you can pass it in as an argument to the `NovuClient` constructor.
|
|||
|
||||
### Create a Notification Template
|
||||
|
||||
For each notification type you want to send, you need to create a template in Novu. This is a one-time setup step that you can do on the Novu web interface.
|
||||
For each notification type you want to send, you need to create a template in Novu. This is a one-time setup step that you can do on the Novu web interface.
|
||||
|
||||
It is possible to customize the notification content at each invocation via handlebars-style placeholders. For example, you can create a template for an email notification that looks like this:
|
||||
|
||||
|
@ -65,7 +65,7 @@ To create a template, follow these steps:
|
|||
|
||||

|
||||
|
||||
7. When you're done, click "Update" on the top-right.
|
||||
7. When you're done, click "Update" on the top-right.
|
||||
|
||||
You are now ready to send SMS notifications via the API! For example, to manually trigger a notification via the Agentic Novu Service client:
|
||||
|
||||
|
|
|
@ -55,21 +55,21 @@ You may provide these alternatively when instantiating the service via the `apiK
|
|||
|
||||

|
||||
|
||||
7. Review the OAuth scopes and enabled features and proceed by clicking "Create"
|
||||
6. Review the OAuth scopes and enabled features and proceed by clicking "Create"
|
||||
|
||||

|
||||
|
||||
8. Click "Install to Workspace" to install your application to your workspace:
|
||||
7. Click "Install to Workspace" to install your application to your workspace:
|
||||
|
||||

|
||||
|
||||
9. Almost there! To obtain the API key for the Agentic Service, click "OAuth & Permissions" in the left navigation menu of the Slack Dashboard of your application and scroll down to the "OAuth Tokens for Your Workspace" section.
|
||||
|
||||
8. Almost there! To obtain the API key for the Agentic Service, click "OAuth & Permissions" in the left navigation menu of the Slack Dashboard of your application and scroll down to the "OAuth Tokens for Your Workspace" section.
|
||||
|
||||

|
||||
|
||||
10. Click "Copy" to copy the Bot User OAuth API Key to your clipboard.
|
||||
9. Click "Copy" to copy the Bot User OAuth API Key to your clipboard.
|
||||
|
||||

|
||||

|
||||
|
||||
### How to Retrieve Channel ID
|
||||
|
||||
|
|
|
@ -10,10 +10,10 @@ Twilio offers a free [trial account][twilio-trial] with a small balance that you
|
|||
|
||||
Ensure the following environment variables are set:
|
||||
|
||||
- `TWILIO_ACCOUNT_SID`: Your Twilio account SID
|
||||
- `TWILIO_AUTH_TOKEN`: Your Twilio auth token
|
||||
- `TWILIO_PHONE_NUMBER`: Your Twilio phone number from which the Agentic service will send text messages
|
||||
- `TWILIO_DEFAULT_RECIPIENT_PHONE_NUMBER`: The default recipient phone number to use if none is specified in the workflow
|
||||
- `TWILIO_ACCOUNT_SID`: Your Twilio account SID
|
||||
- `TWILIO_AUTH_TOKEN`: Your Twilio auth token
|
||||
- `TWILIO_PHONE_NUMBER`: Your Twilio phone number from which the Agentic service will send text messages
|
||||
- `TWILIO_DEFAULT_RECIPIENT_PHONE_NUMBER`: The default recipient phone number to use if none is specified in the workflow
|
||||
|
||||
Otherwise, these can be passed directly to the `TwilioConversationClient` constructor.
|
||||
|
||||
|
|
102
package.json
102
package.json
|
@ -1,102 +1,50 @@
|
|||
{
|
||||
"name": "agentic",
|
||||
"private": true,
|
||||
"description": "TODO",
|
||||
"description": "Everything you need to build reliable AI agents with TypeScript.",
|
||||
"author": "Travis Fischer <travis@transitivebullsh.it>",
|
||||
"repository": "transitive-bullshit/agentic",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"source": "./src/index.ts",
|
||||
"types": "./build/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./build/index.js",
|
||||
"require": "./build/index.cjs",
|
||||
"types": "./build/index.d.ts",
|
||||
"default": "./build/index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"build"
|
||||
],
|
||||
"packageManager": "pnpm@8.6.2",
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
"node": ">=18"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"dev": "tsup --watch",
|
||||
"clean": "del build",
|
||||
"lint": "eslint \"**/*.ts\" --fix",
|
||||
"prebuild": "run-s clean",
|
||||
"predev": "run-s clean",
|
||||
"pretest": "run-s build",
|
||||
"build": "turbo build --filter=\"./packages/*\"",
|
||||
"changeset": "changeset",
|
||||
"clean": "turbo clean --filter=\"./packages/*\"",
|
||||
"dev": "turbo dev --no-cache --continue",
|
||||
"prepare": "husky install",
|
||||
"pre-commit": "lint-staged",
|
||||
"test": "run-s test:*",
|
||||
"test:unit": "NODE_OPTIONS='--loader=tsx --no-warnings' ava",
|
||||
"test:prettier": "prettier \"**/*.{js,jsx,ts,tsx}\" --check",
|
||||
"test:eslint": "eslint \"**/*.ts\"",
|
||||
"test-cov": "c8 ava"
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentic/midjourney-fetch": "^1.0.1",
|
||||
"@anthropic-ai/sdk": "^0.4.4",
|
||||
"@inquirer/checkbox": "^1.3.2",
|
||||
"@inquirer/editor": "^1.2.1",
|
||||
"@inquirer/input": "^1.2.2",
|
||||
"@inquirer/select": "^1.2.2",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"colorette": "^2.0.20",
|
||||
"debug": "^4.3.4",
|
||||
"expr-eval": "^2.0.2",
|
||||
"handlebars": "^4.7.7",
|
||||
"is-relative-url": "^4.0.0",
|
||||
"is-unicode-supported": "^1.3.0",
|
||||
"js-tiktoken": "^1.0.7",
|
||||
"jsonrepair": "^3.2.0",
|
||||
"ky": "^0.33.3",
|
||||
"nanoid": "^4.0.2",
|
||||
"normalize-url": "^8.0.0",
|
||||
"openai-fetch": "^1.6.3",
|
||||
"p-map": "^6.0.0",
|
||||
"p-retry": "^5.1.2",
|
||||
"p-throttle": "^5.1.0",
|
||||
"p-timeout": "^6.1.2",
|
||||
"quick-lru": "^6.1.1",
|
||||
"replicate": "^0.12.3",
|
||||
"ts-dedent": "^2.2.0",
|
||||
"zod": "^3.21.4",
|
||||
"zod-to-json-schema": "^3.21.3",
|
||||
"zod-validation-error": "^1.3.1"
|
||||
"publint": "turbo publint --filter=\"packages/*\"",
|
||||
"release": "turbo clean && turbo build && changeset publish",
|
||||
"test": "turbo test",
|
||||
"eslint-check": "eslint \"**/*.{ts,tsx}\"",
|
||||
"prettier-check": "prettier --check \"**/*.{js,ts,tsx,md,mdx}\"",
|
||||
"prettier-write": "prettier --write \"**/*.{js,ts,tsx,md,mdx}\"",
|
||||
"version-packages": "changeset version"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@keyv/redis": "^2.6.1",
|
||||
"@changesets/cli": "^2.26.2",
|
||||
"@trivago/prettier-plugin-sort-imports": "^4.1.1",
|
||||
"@types/debug": "^4.1.8",
|
||||
"@types/node": "^20.3.2",
|
||||
"@types/sinon": "^10.0.15",
|
||||
"@typescript-eslint/eslint-plugin": "^5.60.1",
|
||||
"@typescript-eslint/parser": "^5.60.1",
|
||||
"ava": "^5.3.1",
|
||||
"c8": "^8.0.0",
|
||||
"del-cli": "^5.0.0",
|
||||
"dotenv": "^16.3.1",
|
||||
"eslint": "^8.43.0",
|
||||
"eslint-plugin-tsdoc": "^0.2.17",
|
||||
"expect-type": "^0.16.0",
|
||||
"hash-obj": "^4.0.0",
|
||||
"husky": "^8.0.3",
|
||||
"ioredis": "^5.3.2",
|
||||
"keyv": "^4.5.2",
|
||||
"lint-staged": "^13.2.3",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"p-memoize": "^7.1.1",
|
||||
"prettier": "^2.8.8",
|
||||
"react": "^18.2.0",
|
||||
"publint": "^0.1.12",
|
||||
"sinon": "^15.2.0",
|
||||
"tsup": "7.1.0",
|
||||
"tsx": "^3.12.7",
|
||||
"type-fest": "^3.12.0",
|
||||
"turbo": "^1.10.6",
|
||||
"typedoc": "^0.24.8",
|
||||
"typedoc-plugin-markdown": "4.0.0-next.16",
|
||||
"typescript": "^5.1.6"
|
||||
|
@ -104,18 +52,7 @@
|
|||
"lint-staged": {
|
||||
"*.{ts,tsx}": [
|
||||
"eslint --fix",
|
||||
"prettier --write"
|
||||
]
|
||||
},
|
||||
"ava": {
|
||||
"snapshotDir": "test/.snapshots",
|
||||
"failFast": true,
|
||||
"extensions": {
|
||||
"ts": "module"
|
||||
},
|
||||
"nodeArguments": [
|
||||
"--loader=tsx",
|
||||
"--no-warnings"
|
||||
"prettier --ignore-unknown --write"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
|
@ -129,7 +66,8 @@
|
|||
"llms",
|
||||
"chatgpt",
|
||||
"openapi",
|
||||
"functions",
|
||||
"guardrails",
|
||||
"plugins"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
@ -0,0 +1,99 @@
|
|||
{
|
||||
"name": "@agentic/core",
|
||||
"description": "Reliable building blocks for TypeScript AI agents.",
|
||||
"repository": "transitive-bullshit/agentic",
|
||||
"license": "MIT",
|
||||
"type": "module",
|
||||
"sideEffects": false,
|
||||
"source": "./src/index.ts",
|
||||
"types": "./build/index.d.ts",
|
||||
"exports": {
|
||||
"./package.json": "./package.json",
|
||||
".": {
|
||||
"import": "./build/index.js",
|
||||
"require": "./build/index.cjs",
|
||||
"types": "./build/index.d.ts",
|
||||
"default": "./build/index.js"
|
||||
}
|
||||
},
|
||||
"files": [
|
||||
"build"
|
||||
],
|
||||
"engines": {
|
||||
"node": ">=14"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "tsup",
|
||||
"dev": "tsup --watch",
|
||||
"clean": "del build",
|
||||
"test": "NODE_OPTIONS='--loader=tsx --no-warnings' ava"
|
||||
},
|
||||
"dependencies": {
|
||||
"@agentic/midjourney-fetch": "^1.0.1",
|
||||
"@anthropic-ai/sdk": "^0.4.4",
|
||||
"@inquirer/checkbox": "^1.3.2",
|
||||
"@inquirer/editor": "^1.2.1",
|
||||
"@inquirer/input": "^1.2.2",
|
||||
"@inquirer/select": "^1.2.2",
|
||||
"@types/json-schema": "^7.0.12",
|
||||
"colorette": "^2.0.20",
|
||||
"debug": "^4.3.4",
|
||||
"expr-eval": "^2.0.2",
|
||||
"handlebars": "^4.7.7",
|
||||
"is-relative-url": "^4.0.0",
|
||||
"is-unicode-supported": "^1.3.0",
|
||||
"js-tiktoken": "^1.0.7",
|
||||
"jsonrepair": "^3.2.0",
|
||||
"ky": "^0.33.3",
|
||||
"nanoid": "^4.0.2",
|
||||
"normalize-url": "^8.0.0",
|
||||
"openai-fetch": "^1.6.3",
|
||||
"p-map": "^6.0.0",
|
||||
"p-memoize": "^7.1.1",
|
||||
"p-retry": "^5.1.2",
|
||||
"p-throttle": "^5.1.0",
|
||||
"p-timeout": "^6.1.2",
|
||||
"quick-lru": "^6.1.1",
|
||||
"replicate": "^0.12.3",
|
||||
"ts-dedent": "^2.2.0",
|
||||
"type-fest": "^3.12.0",
|
||||
"zod": "^3.21.4",
|
||||
"zod-to-json-schema": "^3.21.3",
|
||||
"zod-validation-error": "^1.3.1"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@keyv/redis": "^2.6.1",
|
||||
"@types/debug": "^4.1.8",
|
||||
"@types/node": "^20.3.2",
|
||||
"@types/sinon": "^10.0.15",
|
||||
"expect-type": "^0.16.0",
|
||||
"hash-obj": "^4.0.0",
|
||||
"ioredis": "^5.3.2",
|
||||
"keyv": "^4.5.2"
|
||||
},
|
||||
"ava": {
|
||||
"snapshotDir": "test/.snapshots",
|
||||
"failFast": true,
|
||||
"extensions": {
|
||||
"ts": "module"
|
||||
},
|
||||
"nodeArguments": [
|
||||
"--loader=tsx",
|
||||
"--no-warnings"
|
||||
]
|
||||
},
|
||||
"keywords": [
|
||||
"ai",
|
||||
"openai",
|
||||
"autonomous",
|
||||
"agent",
|
||||
"agi",
|
||||
"autogpt",
|
||||
"babyagi",
|
||||
"llms",
|
||||
"chatgpt",
|
||||
"openapi",
|
||||
"guardrails",
|
||||
"plugins"
|
||||
]
|
||||
}
|
|
@ -12,7 +12,6 @@
|
|||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"isolatedModules": true,
|
||||
"jsx": "preserve",
|
||||
"baseUrl": ".",
|
||||
"outDir": "build",
|
||||
"noEmit": true,
|
||||
|
@ -20,6 +19,6 @@
|
|||
"@/*": ["./src/*"]
|
||||
}
|
||||
},
|
||||
"exclude": ["node_modules", "build"],
|
||||
"include": ["**/*.ts", "**/*.tsx"]
|
||||
"exclude": ["build", "node_modules"],
|
||||
"include": ["."]
|
||||
}
|
|
@ -14,7 +14,6 @@ export default defineConfig([
|
|||
dts: true,
|
||||
esbuildOptions(options) {
|
||||
options.target = 'es2020'
|
||||
options.jsx = 'preserve'
|
||||
}
|
||||
}
|
||||
])
|
3509
pnpm-lock.yaml
3509
pnpm-lock.yaml
Plik diff jest za duży
Load Diff
|
@ -0,0 +1,4 @@
|
|||
packages:
|
||||
- 'packages/*'
|
||||
- 'docs'
|
||||
- 'examples'
|
|
@ -0,0 +1,40 @@
|
|||
{
|
||||
"$schema": "https://turbo.build/schema.json",
|
||||
"pipeline": {
|
||||
"build": {
|
||||
"dependsOn": ["^build", "clean"],
|
||||
"outputs": ["build/**"]
|
||||
},
|
||||
"lint": {
|
||||
"dependsOn": ["^build", "build"]
|
||||
},
|
||||
"type-check": {
|
||||
"dependsOn": ["^build", "build"]
|
||||
},
|
||||
"test": {
|
||||
"dependsOn": [
|
||||
"^build",
|
||||
"build",
|
||||
"unit-test",
|
||||
"prettier-check",
|
||||
"eslint-check"
|
||||
]
|
||||
},
|
||||
"prettier-check": {},
|
||||
"eslint-check": {},
|
||||
"unit-test": {
|
||||
"outputs": ["test/.snapshots"]
|
||||
},
|
||||
"publint": {
|
||||
"dependsOn": ["^build", "build"]
|
||||
},
|
||||
"clean": {
|
||||
"dependsOn": ["^clean"],
|
||||
"outputs": ["build/**", "dist/**"]
|
||||
},
|
||||
"dev": {
|
||||
"cache": false,
|
||||
"persistent": true
|
||||
}
|
||||
}
|
||||
}
|
10
typedoc.json
10
typedoc.json
|
@ -1,13 +1,9 @@
|
|||
{
|
||||
"$schema": "https://typedoc.org/schema.json",
|
||||
"entryPoints": [
|
||||
"./src/index.ts"
|
||||
],
|
||||
"entryPoints": ["./packages/core/src/index.ts"],
|
||||
"tsconfig": "./tsconfig.json",
|
||||
"readme": "./readme.md",
|
||||
"plugin": [
|
||||
"typedoc-plugin-markdown"
|
||||
],
|
||||
"plugin": ["typedoc-plugin-markdown"],
|
||||
"out": "./docs/api",
|
||||
"hideGenerator": true,
|
||||
"excludePrivate": true,
|
||||
|
@ -40,4 +36,4 @@
|
|||
"GetSignature",
|
||||
"SetSignature"
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
Ładowanie…
Reference in New Issue