mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-07 22:24:06 -05:00
feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue, added descriptions & param validation & updated docs (#825)
* feat(tools): added hunter.io tools/block, added default values of first option in dropdowns to avoid operation selector issue * fix * added description for all outputs, fixed param validation for tools * cleanup * add dual validation, once during serialization and once during execution * improvement(docs): add base exec charge info to docs (#826) * improvement(doc-tags-subblock): use table for doc tags subblock in create_document tool for KB (#827) * improvement(doc-tags-subblock): use table for doc tags create doc tool in KB block * enforce max tags * remove red warning text * fix(bugs): fixed rb2b csp, fixed overly-verbose logs, fixed x URLs (#828) Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local> * fixed serialization errors to appear like execution errors, also fixed contrast on cmdk modal * fixed required for tools, added tag dropdown for kb tags * fix remaining tools with required fields * update utils * update docs * fix kb tags * fix types for exa * lint * updated contributing guide + pr template * Test pre-commit hook with linting * Test pre-commit hook again * remove test files * fixed wealthbox tool * update telemetry endpoints --------- Co-authored-by: waleedlatif <waleedlatif@waleedlatifs-MacBook-Pro.local> Co-authored-by: Vikhyath Mondreti <vikhyathvikku@gmail.com>
This commit is contained in:
59
.github/CONTRIBUTING.md
vendored
59
.github/CONTRIBUTING.md
vendored
@@ -301,8 +301,8 @@ In addition, you will need to update the registries:
|
||||
|
||||
```typescript:/apps/sim/blocks/blocks/pinecone.ts
|
||||
import { PineconeIcon } from '@/components/icons'
|
||||
import { PineconeResponse } from '@/tools/pinecone/types'
|
||||
import { BlockConfig } from '../types'
|
||||
import type { BlockConfig } from '@/blocks/types'
|
||||
import type { PineconeResponse } from '@/tools/pinecone/types'
|
||||
|
||||
export const PineconeBlock: BlockConfig<PineconeResponse> = {
|
||||
type: 'pinecone',
|
||||
@@ -313,13 +313,58 @@ In addition, you will need to update the registries:
|
||||
bgColor: '#123456',
|
||||
icon: PineconeIcon,
|
||||
|
||||
// If this block requires OAuth authentication
|
||||
provider: 'pinecone',
|
||||
|
||||
// Define subBlocks for the UI configuration
|
||||
subBlocks: [
|
||||
// Block configuration options
|
||||
{
|
||||
id: 'operation',
|
||||
title: 'Operation',
|
||||
type: 'dropdown',
|
||||
layout: 'full',
|
||||
required: true,
|
||||
options: [
|
||||
{ label: 'Generate Embeddings', id: 'generate' },
|
||||
{ label: 'Search Text', id: 'search_text' },
|
||||
],
|
||||
value: () => 'generate',
|
||||
},
|
||||
{
|
||||
id: 'apiKey',
|
||||
title: 'API Key',
|
||||
type: 'short-input',
|
||||
layout: 'full',
|
||||
placeholder: 'Your Pinecone API key',
|
||||
password: true,
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
|
||||
tools: {
|
||||
access: ['pinecone_generate_embeddings', 'pinecone_search_text'],
|
||||
config: {
|
||||
tool: (params: Record<string, any>) => {
|
||||
switch (params.operation) {
|
||||
case 'generate':
|
||||
return 'pinecone_generate_embeddings'
|
||||
case 'search_text':
|
||||
return 'pinecone_search_text'
|
||||
default:
|
||||
throw new Error('Invalid operation selected')
|
||||
}
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
inputs: {
|
||||
operation: { type: 'string', description: 'Operation to perform' },
|
||||
apiKey: { type: 'string', description: 'Pinecone API key' },
|
||||
searchQuery: { type: 'string', description: 'Search query text' },
|
||||
topK: { type: 'string', description: 'Number of results to return' },
|
||||
},
|
||||
|
||||
outputs: {
|
||||
matches: { type: 'any', description: 'Search results or generated embeddings' },
|
||||
data: { type: 'any', description: 'Response data from Pinecone' },
|
||||
usage: { type: 'any', description: 'API usage statistics' },
|
||||
},
|
||||
}
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user