Skip to content

Commit

Permalink
Merge pull request #674 from transitive-bullshit/feature/update-oct-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit authored Oct 22, 2024
2 parents 27599b7 + bf886e8 commit f5b9f0f
Show file tree
Hide file tree
Showing 53 changed files with 3,064 additions and 4,341 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ jobs:
- 20
- 21
- 22
- 23

steps:
- name: Checkout
Expand All @@ -22,7 +23,7 @@ jobs:
- name: Install pnpm
uses: pnpm/action-setup@v4
with:
version: 9.7.0
version: 9.12.2
run_install: false

- name: Install Node.js
Expand Down
3 changes: 2 additions & 1 deletion examples/ai-sdk/bin/browserbase.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
#!/usr/bin/env node
import 'dotenv/config'

import { openai } from '@ai-sdk/openai'
import { createOpenAI } from '@ai-sdk/openai'
import { Browserbase, BrowserbaseAISDK } from '@browserbasehq/sdk'
import { generateText } from 'ai'

async function main() {
const browserbase = new Browserbase()
const openai = createOpenAI({ compatibility: 'strict' })

const browserTool = BrowserbaseAISDK(browserbase, { textContent: true })
console.log(browserTool.parameters)
Expand Down
3 changes: 2 additions & 1 deletion examples/ai-sdk/bin/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,12 @@ import 'dotenv/config'

import { createAISDKTools } from '@agentic/ai-sdk'
import { WeatherClient } from '@agentic/weather'
import { openai } from '@ai-sdk/openai'
import { createOpenAI } from '@ai-sdk/openai'
import { generateText } from 'ai'

async function main() {
const weather = new WeatherClient()
const openai = createOpenAI({ compatibility: 'strict' })

const result = await generateText({
model: openai('gpt-4o-mini'),
Expand Down
5 changes: 2 additions & 3 deletions examples/ai-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,10 @@
},
"dependencies": {
"@agentic/ai-sdk": "workspace:*",
"@agentic/core": "workspace:*",
"@agentic/weather": "workspace:*",
"@ai-sdk/openai": "^0.0.24",
"@ai-sdk/openai": "^0.0.68",
"@browserbasehq/sdk": "^1.4.2",
"ai": "^3.1.30",
"ai": "^3.4.16",
"openai": "^4.49.0",
"zod": "^3.23.8"
},
Expand Down
5 changes: 2 additions & 3 deletions examples/genkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/genkit": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@genkit-ai/ai": "^0.5.9",
"@genkit-ai/core": "^0.5.9",
"@genkit-ai/ai": "^0.5.16",
"@genkit-ai/core": "^0.5.16",
"genkitx-openai": "^0.10.0",
"zod": "^3.23.8"
},
Expand Down
7 changes: 3 additions & 4 deletions examples/langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,11 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/langchain": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@langchain/core": "^0.2.20",
"@langchain/openai": "^0.2.5",
"langchain": "^0.2.12",
"@langchain/core": "^0.3.13",
"@langchain/openai": "^0.3.11",
"langchain": "^0.3.3",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion examples/llamaindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"@agentic/core": "workspace:*",
"@agentic/llamaindex": "workspace:*",
"@agentic/stdlib": "workspace:*",
"llamaindex": "^0.5.13",
"llamaindex": "^0.7.3",
"zod": "^3.23.8"
},
"devDependencies": {
Expand Down
33 changes: 14 additions & 19 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"type": "git",
"url": "git+https://github.com/transitive-bullshit/agentic.git"
},
"packageManager": "pnpm@9.7.0",
"packageManager": "pnpm@9.12.2",
"engines": {
"node": ">=18"
},
Expand All @@ -33,34 +33,29 @@
"prepare": "husky"
},
"devDependencies": {
"@changesets/cli": "^2.27.7",
"@changesets/cli": "^2.27.9",
"@fisch0920/eslint-config": "^1.4.0",
"@total-typescript/ts-reset": "^0.5.1",
"@types/node": "^22.4.0",
"del-cli": "^5.1.0",
"@total-typescript/ts-reset": "^0.6.1",
"@types/node": "^22.7.6",
"del-cli": "^6.0.0",
"dotenv": "^16.4.5",
"eslint": "^8.57.0",
"husky": "^9.1.4",
"lint-staged": "^15.2.9",
"npm-run-all2": "^6.2.2",
"eslint": "^8.57.1",
"husky": "^9.1.6",
"lint-staged": "^15.2.10",
"npm-run-all2": "^7.0.0",
"only-allow": "^1.2.1",
"prettier": "^3.3.3",
"tsup": "^8.2.4",
"tsx": "^4.17.0",
"turbo": "^2.0.14",
"typescript": "^5.5.4",
"vitest": "2.0.5",
"tsup": "^8.3.0",
"tsx": "^4.19.1",
"turbo": "^2.2.3",
"typescript": "^5.6.3",
"vitest": "2.1.3",
"zod": "^3.23.8"
},
"lint-staged": {
"*.{ts,tsx}": [
"prettier --ignore-unknown --write",
"eslint --fix"
]
},
"pnpm": {
"overrides": {
"esbuild": "^0.23.0"
}
}
}
5 changes: 3 additions & 2 deletions packages/ai-sdk/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
"test:typecheck": "tsc --noEmit",
"test:unit": "vitest run"
},
"dependencies": {
"@agentic/core": "workspace:*"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"ai": "^3.1.30"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"ai": "^3.1.30"
},
Expand Down
5 changes: 2 additions & 3 deletions packages/bing/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,14 +31,13 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"ky": "^1.5.0"
"@agentic/core": "workspace:*",
"ky": "^1.7.2"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
Expand Down
4 changes: 1 addition & 3 deletions packages/calculator/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,13 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"ky": "^1.5.0",
"@agentic/core": "workspace:*",
"mathjs": "^13.0.3"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
Expand Down
7 changes: 3 additions & 4 deletions packages/clearbit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"ky": "^1.5.0",
"p-throttle": "^6.1.0"
"@agentic/core": "workspace:*",
"ky": "^1.7.2",
"p-throttle": "^6.2.0"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
Expand Down
15 changes: 7 additions & 8 deletions packages/core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,27 +32,26 @@
"test:unit": "vitest run"
},
"dependencies": {
"@sindresorhus/is": "^7.0.0",
"dedent": "^1.5.3",
"delay": "^6.0.0",
"hash-object": "^5.0.1",
"is-relative-url": "^4.0.0",
"jsonrepair": "^3.6.1",
"ky": "^1.5.0",
"jsonrepair": "^3.9.0",
"ky": "^1.7.2",
"normalize-url": "^8.0.1",
"openai-zod-to-json-schema": "^1.0.0",
"openai-zod-to-json-schema": "^1.0.3",
"p-map": "^7.0.2",
"p-throttle": "^6.1.0",
"p-throttle": "^6.2.0",
"quick-lru": "^7.0.0",
"type-fest": "^4.21.0",
"zod-validation-error": "^3.3.0"
"type-fest": "^4.26.1",
"zod-validation-error": "^3.4.0"
},
"peerDependencies": {
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/tsconfig": "workspace:*",
"openai-fetch": "^3.0.0"
"openai-fetch": "^3.3.1"
},
"publishConfig": {
"access": "public"
Expand Down
26 changes: 5 additions & 21 deletions packages/core/src/assert.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import { isError } from '@sindresorhus/is'

function assertImpl(value: unknown, message?: string | Error): asserts value {
export function assert(
value: unknown,
message?: string | Error
): asserts value {
if (value) {
return
}
Expand All @@ -9,22 +10,5 @@ function assertImpl(value: unknown, message?: string | Error): asserts value {
throw new Error('Assertion failed')
}

throw isError(message) ? message : new Error(message)
throw typeof message === 'string' ? new Error(message) : message
}

/**
* Assertion function that defaults to Node.js's `assert` module if it's
* available, with a basic backup if not.
*/
let assert: (value: unknown, message?: string | Error) => asserts value =
assertImpl

try {
// Default to the Node.js assert module if it's available
const assertImport = await import('node:assert')
if (assertImport?.default) {
assert = assertImport.default
}
} catch {}

export { assert }
2 changes: 1 addition & 1 deletion packages/core/src/extract-object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,5 @@ export function extractObject<Result extends types.AIChainResult = string>(
args: ExtractObjectParams<Result>
): Promise<Result> {
const chain = createAIChain(args)
return chain()
return chain() as Promise<Result>
}
7 changes: 3 additions & 4 deletions packages/dexa/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"ky": "^1.5.0",
"p-throttle": "^6.1.0"
"@agentic/core": "workspace:*",
"ky": "^1.7.2",
"p-throttle": "^6.2.0"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
Expand Down
5 changes: 3 additions & 2 deletions packages/dexter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,13 @@
"test:typecheck": "tsc --noEmit",
"test:unit": "vitest run"
},
"dependencies": {
"@agentic/core": "workspace:*"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"@dexaai/dexter": "^2.1.0"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"@dexaai/dexter": "^2.1.0"
},
Expand Down
7 changes: 3 additions & 4 deletions packages/diffbot/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,14 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"ky": "^1.5.0",
"p-throttle": "^6.1.0"
"@agentic/core": "workspace:*",
"ky": "^1.7.2",
"p-throttle": "^6.2.0"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
Expand Down
9 changes: 5 additions & 4 deletions packages/e2b/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,15 +30,16 @@
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/core": "workspace:*"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"@e2b/code-interpreter": "^0.0.8",
"@e2b/code-interpreter": "^1.0.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"@e2b/code-interpreter": "^0.0.8"
"@e2b/code-interpreter": "^1.0.2"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit f5b9f0f

Please sign in to comment.