Skip to content

Commit

Permalink
chore(repo): Format
Browse files Browse the repository at this point in the history
  • Loading branch information
nikosdouvlis committed Feb 12, 2025
1 parent 80d6835 commit a9913f2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
14 changes: 7 additions & 7 deletions packages/agent-toolkit/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@
"type": "module",
"exports": {
"./langchain": {
"types": "./dist/langchain/index.d.mts",
"import": "./dist/langchain/index.mjs"
"types": "./dist/langchain/index.d.ts",
"import": "./dist/langchain/index.js"
},
"./ai-sdk": {
"types": "./dist/ai-sdk/index.d.mts",
"import": "./dist/ai-sdk/index.mjs"
"types": "./dist/ai-sdk/index.d.ts",
"import": "./dist/ai-sdk/index.js"
}
},
"files": [
Expand All @@ -43,6 +43,9 @@
"@clerk/types": "workspace:^",
"zod": "^3.24.1"
},
"devDependencies": {
"esbuild-plugin-file-path-extensions": "^2.1.4"
},
"peerDependencies": {
"@langchain/core": "^0.3.6",
"ai": "^3.4.7 || ^4.0.0"
Expand All @@ -60,8 +63,5 @@
},
"publishConfig": {
"access": "public"
},
"devDependencies": {
"esbuild-plugin-file-path-extensions": "^2.1.4"
}
}
3 changes: 3 additions & 0 deletions packages/agent-toolkit/src/ai-sdk/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ import { tool } from 'ai';

import type { SdkAdapter } from '../lib/types';

/**
* Converts a `ClerkTool` to an AI SDK `Tool`.
*/
export const adapter: SdkAdapter<Tool> = (clerkClient, context, clerkTool) => {
return tool({
description: clerkTool.description,
Expand Down
5 changes: 4 additions & 1 deletion packages/agent-toolkit/src/langchain/adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ import { tool } from '@langchain/core/tools';

import type { SdkAdapter } from '../lib/types';

// https://js.langchain.com/docs/how_to/custom_tools
/**
* Converts a `ClerkTool` to a LangChain `StructuredTool`.
* For more details, take a look at the LangChain docs https://js.langchain.com/docs/how_to/custom_tools
*/
export const adapter: SdkAdapter<StructuredTool> = (clerkClient, context, clerkTool) => {
return tool(clerkTool.bindRunnable(clerkClient, context), {
name: clerkTool.name,
Expand Down

0 comments on commit a9913f2

Please sign in to comment.