Skip to content

Commit

Permalink
feat: add @agentic/stdlib convenience package
Browse files Browse the repository at this point in the history
  • Loading branch information
transitive-bullshit committed Aug 4, 2024
1 parent a1ebc9d commit c26fc15
Show file tree
Hide file tree
Showing 21 changed files with 520 additions and 131 deletions.
4 changes: 1 addition & 3 deletions examples/dexter/bin/analyze.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@
import 'dotenv/config'

import { createDexterFunctions } from '@agentic/dexter'
import { DiffbotClient } from '@agentic/diffbot'
import { SearchAndCrawl } from '@agentic/search-and-crawl'
import { SerpAPIClient } from '@agentic/serpapi'
import { DiffbotClient, SearchAndCrawl, SerpAPIClient } from '@agentic/stdlib'
import { ChatModel, createAIRunner } from '@dexaai/dexter'

async function main() {
Expand Down
4 changes: 1 addition & 3 deletions examples/dexter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,10 @@
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/dexter": "workspace:*",
"@agentic/diffbot": "workspace:*",
"@agentic/e2b": "workspace:*",
"@agentic/perigon": "workspace:*",
"@agentic/search-and-crawl": "workspace:*",
"@agentic/serpapi": "workspace:*",
"@agentic/serper": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@agentic/weather": "workspace:*",
"@dexaai/dexter": "^2.1.0",
"zod": "^3.23.8"
Expand Down
2 changes: 1 addition & 1 deletion examples/genkit/bin/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import 'dotenv/config'

import { createGenkitTools } from '@agentic/genkit'
import { WeatherClient } from '@agentic/weather'
import { WeatherClient } from '@agentic/stdlib'
import { generate } from '@genkit-ai/ai'
import { configureGenkit } from '@genkit-ai/core'
import { gpt4o, openAI } from 'genkitx-openai'
Expand Down
3 changes: 1 addition & 2 deletions examples/genkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,9 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/ai-sdk": "workspace:*",
"@agentic/core": "workspace:*",
"@agentic/genkit": "workspace:*",
"@agentic/weather": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@genkit-ai/ai": "^0.5.9",
"@genkit-ai/core": "^0.5.9",
"genkitx-openai": "^0.10.0",
Expand Down
2 changes: 1 addition & 1 deletion examples/langchain/bin/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import 'dotenv/config'

import { createLangChainTools } from '@agentic/langchain'
import { WeatherClient } from '@agentic/weather'
import { WeatherClient } from '@agentic/stdlib'
import { ChatPromptTemplate } from '@langchain/core/prompts'
import { ChatOpenAI } from '@langchain/openai'
import { AgentExecutor, createToolCallingAgent } from 'langchain/agents'
Expand Down
2 changes: 1 addition & 1 deletion examples/langchain/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/langchain": "workspace:*",
"@agentic/weather": "workspace:*",
"@agentic/stdlib": "workspace:*",
"@langchain/core": "^0.2.20",
"@langchain/openai": "^0.2.5",
"langchain": "^0.2.12",
Expand Down
2 changes: 1 addition & 1 deletion examples/llamaindex/bin/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import 'dotenv/config'

import { createLlamaIndexTools } from '@agentic/llamaindex'
import { WeatherClient } from '@agentic/weather'
import { WeatherClient } from '@agentic/stdlib'
import { OpenAI, OpenAIAgent } from 'llamaindex'

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/llamaindex/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/llamaindex": "workspace:*",
"@agentic/weather": "workspace:*",
"@agentic/stdlib": "workspace:*",
"llamaindex": "^0.5.13",
"zod": "^3.23.8"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/openai/bin/weather.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import 'dotenv/config'

import { assert } from '@agentic/core'
import { WeatherClient } from '@agentic/weather'
import { WeatherClient } from '@agentic/stdlib'
import OpenAI from 'openai'

async function main() {
Expand Down
2 changes: 1 addition & 1 deletion examples/openai/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/weather": "workspace:*",
"@agentic/stdlib": "workspace:*",
"openai": "^4.49.0",
"zod": "^3.23.8"
},
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/bin/scratch.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env node
import 'dotenv/config'

import { SerperClient } from '@agentic/serper'
import { SerperClient } from '@agentic/stdlib'
import restoreCursor from 'restore-cursor'

/**
Expand Down
2 changes: 1 addition & 1 deletion examples/playground/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
},
"dependencies": {
"@agentic/core": "workspace:*",
"@agentic/serper": "workspace:*",
"@agentic/stdlib": "workspace:*",
"restore-cursor": "^5.1.0",
"zod": "^3.23.8"
},
Expand Down
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@agentic/core",
"version": "6.6.1",
"description": "AI function stdlib that works with any LLM and TypeScript AI SDK.",
"description": "Core agentic AI utils which work with any LLM and TypeScript AI SDK.",
"author": "Travis Fischer <[email protected]>",
"license": "MIT",
"repository": {
Expand Down
5 changes: 2 additions & 3 deletions packages/github/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@
},
"dependencies": {
"ky": "^1.5.0",
"octokit": "^4.0.2",
"p-throttle": "^6.1.0"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"octokit": "^4.0.2",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"octokit": "^4.0.2"
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
"access": "public"
Expand Down
84 changes: 84 additions & 0 deletions packages/stdlib/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
{
"name": "@agentic/stdlib",
"version": "6.6.1",
"description": "Standard library of AI functions which work with any LLM and TypeScript AI SDK.",
"author": "Travis Fischer <[email protected]>",
"license": "MIT",
"repository": {
"type": "git",
"url": "git+https://github.com/transitive-bullshit/agentic.git"
},
"type": "module",
"source": "./src/index.ts",
"types": "./dist/index.d.ts",
"sideEffects": false,
"exports": {
".": {
"types": "./dist/index.d.ts",
"import": "./dist/index.js",
"default": "./dist/index.js"
}
},
"files": [
"dist"
],
"scripts": {
"build": "tsup --config ../../tsup.config.ts",
"dev": "tsup --config ../../tsup.config.ts --watch",
"clean": "del dist",
"test": "run-s test:*",
"test:lint": "eslint .",
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@agentic/ai-sdk": "workspace:*",
"@agentic/bing": "workspace:*",
"@agentic/calculator": "workspace:*",
"@agentic/clearbit": "workspace:*",
"@agentic/dexa": "workspace:*",
"@agentic/dexter": "workspace:*",
"@agentic/diffbot": "workspace:*",
"@agentic/e2b": "workspace:*",
"@agentic/exa": "workspace:*",
"@agentic/firecrawl": "workspace:*",
"@agentic/genkit": "workspace:*",
"@agentic/github": "workspace:*",
"@agentic/hacker-news": "workspace:*",
"@agentic/hunter": "workspace:*",
"@agentic/jina": "workspace:*",
"@agentic/langchain": "workspace:*",
"@agentic/llamaindex": "workspace:*",
"@agentic/midjourney": "workspace:*",
"@agentic/novu": "workspace:*",
"@agentic/people-data-labs": "workspace:*",
"@agentic/perigon": "workspace:*",
"@agentic/polygon": "workspace:*",
"@agentic/predict-leads": "workspace:*",
"@agentic/proxycurl": "workspace:*",
"@agentic/search-and-crawl": "workspace:*",
"@agentic/searxng": "workspace:*",
"@agentic/serpapi": "workspace:*",
"@agentic/serper": "workspace:*",
"@agentic/slack": "workspace:*",
"@agentic/social-data": "workspace:*",
"@agentic/tavily": "workspace:*",
"@agentic/twilio": "workspace:*",
"@agentic/twitter": "workspace:*",
"@agentic/weather": "workspace:*",
"@agentic/wikidata": "workspace:*",
"@agentic/wikipedia": "workspace:*",
"@agentic/wolfram-alpha": "workspace:*",
"@e2b/code-interpreter": "^0.0.8"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
"access": "public"
}
}
32 changes: 32 additions & 0 deletions packages/stdlib/src/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
export * from '@agentic/bing'
export * from '@agentic/calculator'
export * from '@agentic/clearbit'
export * from '@agentic/dexa'
export * from '@agentic/diffbot'
export * from '@agentic/e2b'
export * from '@agentic/exa'
export * from '@agentic/firecrawl'
export * from '@agentic/github'
export * from '@agentic/hacker-news'
export * from '@agentic/hunter'
export * from '@agentic/jina'
export * from '@agentic/midjourney'
export * from '@agentic/novu'
export * from '@agentic/people-data-labs'
export * from '@agentic/perigon'
export * from '@agentic/polygon'
export * from '@agentic/predict-leads'
export * from '@agentic/proxycurl'
export * from '@agentic/search-and-crawl'
export * from '@agentic/searxng'
export * from '@agentic/serpapi'
export * from '@agentic/serper'
export * from '@agentic/slack'
export * from '@agentic/social-data'
export * from '@agentic/tavily'
export * from '@agentic/twilio'
export * from '@agentic/twitter'
export * from '@agentic/weather'
export * from '@agentic/wikidata'
export * from '@agentic/wikipedia'
export * from '@agentic/wolfram-alpha'
5 changes: 5 additions & 0 deletions packages/stdlib/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{
"extends": "@agentic/tsconfig/base.json",
"include": ["src"],
"exclude": ["node_modules", "dist"]
}
10 changes: 4 additions & 6 deletions packages/twitter/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,21 +31,19 @@
"test:typecheck": "tsc --noEmit"
},
"dependencies": {
"@nangohq/node": "^0.42.2",
"ky": "^1.5.0",
"p-throttle": "^6.1.0",
"twitter-api-sdk": "^1.2.1",
"type-fest": "^4.21.0"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8",
"@nangohq/node": "^0.42.2",
"twitter-api-sdk": "^1.2.1"
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"@nangohq/node": "^0.42.2",
"twitter-api-sdk": "^1.2.1"
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
"access": "public"
Expand Down
9 changes: 4 additions & 5 deletions packages/wikidata/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,17 +32,16 @@
},
"dependencies": {
"ky": "^1.5.0",
"p-throttle": "^6.1.0"
"p-throttle": "^6.1.0",
"wikibase-sdk": "^10.0.3"
},
"peerDependencies": {
"@agentic/core": "workspace:*",
"zod": "^3.23.8",
"wikibase-sdk": "^10.0.3"
"zod": "^3.23.8"
},
"devDependencies": {
"@agentic/core": "workspace:*",
"@agentic/tsconfig": "workspace:*",
"wikibase-sdk": "^10.0.3"
"@agentic/tsconfig": "workspace:*"
},
"publishConfig": {
"access": "public"
Expand Down
Loading

0 comments on commit c26fc15

Please sign in to comment.