Skip to content

Commit 7544557

Browse files
committed
feat(langsmith): add langsmith tools for logging, output selector use tool-aware listing
1 parent 3f1dccd commit 7544557

File tree

19 files changed

+1030
-185
lines changed

19 files changed

+1030
-185
lines changed

.claude/commands/add-block.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -577,6 +577,17 @@ export const ServiceBlock: BlockConfig = {
577577

578578
See the `/add-trigger` skill for creating triggers.
579579

580+
## Icon Requirement
581+
582+
If the icon doesn't already exist in `@/components/icons.tsx`, **do NOT search for it yourself**. After completing the block, ask the user to provide the SVG:
583+
584+
```
585+
The block is complete, but I need an icon for {Service}.
586+
Please provide the SVG and I'll convert it to a React component.
587+
588+
You can usually find this in the service's brand/press kit page, or copy it from their website.
589+
```
590+
580591
## Checklist Before Finishing
581592

582593
- [ ] All subBlocks have `id`, `title` (except switch), and `type`
@@ -588,4 +599,5 @@ See the `/add-trigger` skill for creating triggers.
588599
- [ ] Tools.config.tool returns correct tool ID
589600
- [ ] Outputs match tool outputs
590601
- [ ] Block registered in registry.ts
602+
- [ ] If icon missing: asked user to provide SVG
591603
- [ ] If triggers exist: `triggers` config set, trigger subBlocks spread

.claude/commands/add-integration.md

Lines changed: 26 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -226,17 +226,26 @@ export function {Service}Icon(props: SVGProps<SVGSVGElement>) {
226226
fill="none"
227227
xmlns="http://www.w3.org/2000/svg"
228228
>
229-
{/* SVG paths from brand assets */}
229+
{/* SVG paths from user-provided SVG */}
230230
</svg>
231231
)
232232
}
233233
```
234234

235-
### Finding Icons
236-
1. Check the service's brand/press kit page
237-
2. Download SVG logo
238-
3. Convert to React component
239-
4. Ensure it accepts and spreads props
235+
### Getting Icons
236+
**Do NOT search for icons yourself.** At the end of implementation, ask the user to provide the SVG:
237+
238+
```
239+
I've completed the integration. Before I can add the icon, please provide the SVG for {Service}.
240+
You can usually find this in the service's brand/press kit page, or copy it from their website.
241+
242+
Paste the SVG code here and I'll convert it to a React component.
243+
```
244+
245+
Once the user provides the SVG:
246+
1. Extract the SVG paths/content
247+
2. Create a React component that spreads props
248+
3. Ensure viewBox is preserved from the original SVG
240249

241250
## Step 5: Create Triggers (Optional)
242251

@@ -405,6 +414,7 @@ If creating V2 versions (API-aligned outputs):
405414
- [ ] If triggers: spread trigger subBlocks with `getTrigger()`
406415

407416
### Icon
417+
- [ ] Asked user to provide SVG
408418
- [ ] Added icon to `components/icons.tsx`
409419
- [ ] Icon spreads props correctly
410420

@@ -433,11 +443,18 @@ You: I'll add the Stripe integration. Let me:
433443
1. First, research the Stripe API using Context7
434444
2. Create the tools for key operations (payments, subscriptions, etc.)
435445
3. Create the block with operation dropdown
436-
4. Add the Stripe icon
437-
5. Register everything
438-
6. Generate docs
446+
4. Register everything
447+
5. Generate docs
448+
6. Ask you for the Stripe icon SVG
439449
440450
[Proceed with implementation...]
451+
452+
[After completing steps 1-5...]
453+
454+
I've completed the Stripe integration. Before I can add the icon, please provide the SVG for Stripe.
455+
You can usually find this in the service's brand/press kit page, or copy it from their website.
456+
457+
Paste the SVG code here and I'll convert it to a React component.
441458
```
442459

443460
## Common Gotchas

apps/docs/components/icons.tsx

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1853,6 +1853,14 @@ export function LinearIcon(props: React.SVGProps<SVGSVGElement>) {
18531853
)
18541854
}
18551855

1856+
export function LangsmithIcon(props: SVGProps<SVGSVGElement>) {
1857+
return (
1858+
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='currentColor'>
1859+
<circle cx='12' cy='12' r='10' />
1860+
</svg>
1861+
)
1862+
}
1863+
18561864
export function LemlistIcon(props: SVGProps<SVGSVGElement>) {
18571865
return (
18581866
<svg {...props} xmlns='http://www.w3.org/2000/svg' viewBox='0 0 180 181' fill='none'>

apps/docs/components/ui/icon-mapping.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ import {
5555
JiraIcon,
5656
JiraServiceManagementIcon,
5757
KalshiIcon,
58+
LangsmithIcon,
5859
LemlistIcon,
5960
LinearIcon,
6061
LinkedInIcon,
@@ -180,6 +181,7 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
180181
jira_service_management: JiraServiceManagementIcon,
181182
kalshi: KalshiIcon,
182183
knowledge: PackageSearchIcon,
184+
langsmith: LangsmithIcon,
183185
lemlist: LemlistIcon,
184186
linear: LinearIcon,
185187
linkedin: LinkedInIcon,
@@ -231,7 +233,6 @@ export const blockTypeToIconMap: Record<string, IconComponent> = {
231233
supabase: SupabaseIcon,
232234
tavily: TavilyIcon,
233235
telegram: TelegramIcon,
234-
thinking: BrainIcon,
235236
tinybird: TinybirdIcon,
236237
translate: TranslateIcon,
237238
trello: TrelloIcon,
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
---
2+
title: LangSmith
3+
description: Forward workflow runs to LangSmith for observability
4+
---
5+
6+
import { BlockInfoCard } from "@/components/ui/block-info-card"
7+
8+
<BlockInfoCard
9+
type="langsmith"
10+
color="#1B5DFF"
11+
/>
12+
13+
## Usage Instructions
14+
15+
Send run data to LangSmith to trace executions, attach metadata, and monitor workflow performance.
16+
17+
18+
19+
## Tools
20+
21+
### `langsmith_create_run`
22+
23+
Forward a single run to LangSmith for ingestion.
24+
25+
#### Input
26+
27+
| Parameter | Type | Required | Description |
28+
| --------- | ---- | -------- | ----------- |
29+
| `apiKey` | string | Yes | LangSmith API key |
30+
| `runId` | string | Yes | Unique run identifier |
31+
| `name` | string | Yes | Run name |
32+
| `runType` | string | Yes | Run type \(tool, chain, llm, retriever, embedding, prompt, parser\) |
33+
| `startTime` | string | Yes | Run start time in ISO-8601 format |
34+
| `endTime` | string | No | Run end time in ISO-8601 format |
35+
36+
#### Output
37+
38+
This tool does not produce any outputs.
39+
40+
### `langsmith_create_runs_batch`
41+
42+
Forward multiple runs to LangSmith in a single batch.
43+
44+
#### Input
45+
46+
| Parameter | Type | Required | Description |
47+
| --------- | ---- | -------- | ----------- |
48+
| `apiKey` | string | Yes | LangSmith API key |
49+
| `post` | json | No | Array of new runs to ingest |
50+
| `patch` | json | No | Array of runs to update/patch |
51+
52+
#### Output
53+
54+
| Parameter | Type | Description |
55+
| --------- | ---- | ----------- |
56+
| `accepted` | boolean | Whether the batch was accepted for ingestion |
57+
| `runIds` | array | Run identifiers provided in the request |
58+
59+

apps/docs/content/docs/en/tools/meta.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"jira_service_management",
5353
"kalshi",
5454
"knowledge",
55+
"langsmith",
5556
"lemlist",
5657
"linear",
5758
"linkedin",
@@ -103,7 +104,6 @@
103104
"supabase",
104105
"tavily",
105106
"telegram",
106-
"thinking",
107107
"tinybird",
108108
"translate",
109109
"trello",

apps/docs/content/docs/en/tools/tinybird.mdx

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,3 @@ Execute SQL queries against Tinybird Pipes and Data Sources using the Query API.
6363
| `statistics` | json | Query execution statistics - elapsed time, rows read, bytes read \(only available with FORMAT JSON\) |
6464

6565

66-
67-
## Notes
68-
69-
- Category: `tools`
70-
- Type: `tinybird`

apps/sim/app/workspace/[workspaceId]/w/[workflowId]/components/chat/components/output-select/output-select.tsx

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import {
88
extractFieldsFromSchema,
99
parseResponseFormatSafely,
1010
} from '@/lib/core/utils/response-format'
11+
import { getToolOutputs } from '@/lib/workflows/blocks/block-outputs'
1112
import { getBlock } from '@/blocks'
1213
import { useWorkflowDiffStore } from '@/stores/workflow-diff/store'
1314
import { useSubBlockStore } from '@/stores/workflows/subblock/store'
@@ -128,6 +129,10 @@ export function OutputSelect({
128129
? baselineWorkflow.blocks?.[block.id]?.subBlocks?.responseFormat?.value
129130
: subBlockValues?.[block.id]?.responseFormat
130131
const responseFormat = parseResponseFormatSafely(responseFormatValue, block.id)
132+
const operationValue =
133+
shouldUseBaseline && baselineWorkflow
134+
? baselineWorkflow.blocks?.[block.id]?.subBlocks?.operation?.value
135+
: subBlockValues?.[block.id]?.operation
131136

132137
let outputsToProcess: Record<string, unknown> = {}
133138

@@ -141,7 +146,12 @@ export function OutputSelect({
141146
outputsToProcess = blockConfig?.outputs || {}
142147
}
143148
} else {
144-
outputsToProcess = blockConfig?.outputs || {}
149+
const toolOutputs =
150+
blockConfig && typeof operationValue === 'string'
151+
? getToolOutputs(blockConfig, operationValue)
152+
: {}
153+
outputsToProcess =
154+
Object.keys(toolOutputs).length > 0 ? toolOutputs : blockConfig?.outputs || {}
145155
}
146156

147157
if (Object.keys(outputsToProcess).length === 0) return

0 commit comments

Comments
 (0)