-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: airtable query tool #10
Conversation
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
43a5d5b
to
563810f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Few simplification. Overall, great job 🚀
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
…y-tools into feat/airtable-tool
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
Signed-off-by: James Sutton <james.sutton@uk.ibm.com>
Signed-off-by: Graham White <gwhite@uk.ibm.com>
const llm = | ||
process.env.GENAI_API_KEY !== undefined | ||
? BAMChatLLM.fromPreset("meta-llama/llama-3-1-70b-instruct") | ||
: process.env.WATSONX_API_KEY !== undefined && process.env.WATSONX_PROJECT_ID !== undefined | ||
? WatsonXChatLLM.fromPreset("meta-llama/llama-3-1-70b-instruct", { | ||
apiKey: process.env.WATSONX_API_KEY, //pragma: allowlist secret | ||
projectId: process.env.WATSONX_PROJECT_ID, | ||
parameters: { | ||
decoding_method: "greedy", | ||
min_new_tokens: 5, | ||
max_new_tokens: 50, | ||
}, | ||
}) | ||
: process.env.OPENAI_API_KEY !== undefined | ||
? new OpenAIChatLLM() | ||
: new OllamaChatLLM({ modelId: "llama3.1" }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consider using a factory function.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah, this was a bit of a quick-and-dirty hack! Ternaries are bad enough but nested ternaries make for horrible reading, hence the comment above the code.
Which issue(s) does this pull-request address?
Closes: N/A - New feature
Description
This PR introduces a new tool that allows the agent to query an Airtable base. It exposes two actions to the agent that it can execute:
GET_SCHEMA
- Returns a JSON schema of the Airtable base listing tables, their fields and types.QUERY_TABLE
- Allows the agent to query an Airtable table using a formula filter and a field filter. Records are returned in JSON.Checklist
yarn lint
oryarn lint:fix
yarn format
oryarn format:fix
yarn test:unit
yarn test:e2e