-
Notifications
You must be signed in to change notification settings - Fork 4.4k
feat: add TS Pre, post and schema processors to doc #1088
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
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.
👍 Looks good to me! Reviewed everything up to 56680fc in 19 seconds
More details
- Looked at
227
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
2
drafted comments based on config settings.
1. docs/patterns/tools/use-tools/processing-actions.mdx:165
- Draft comment:
Ensure thattoolResponse.data
is defined and has anid
property before accessing it to avoid runtime errors. Consider using optional chaining or a conditional check. - Reason this comment was not posted:
Comment did not seem useful.
2. docs/patterns/tools/use-tools/processing-actions.mdx:67
- Draft comment:
There's a typo in the key 'successfull'. It should be 'successful'. - Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_FR9wuM3TtSAFvsjn
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
appName: string; | ||
toolResponse: ActionExecutionResDto; | ||
}) => { | ||
const issueId = toolResponse.data.id; |
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 adding error handling for the case when toolResponse.data.id
is undefined:
const postProcessor: TPostProcessor = ({ actionName, appName, toolResponse }: {
actionName: string;
appName: string;
toolResponse: ActionExecutionResDto;
}) => {
if (!toolResponse.data?.id) {
return { data: null, successful: false, error: 'No issue ID found in response' };
}
const issueId = toolResponse.data.id;
return { data: { id: issueId }, successful: true };
}
<Step title="Schema Modifier"> | ||
This will be used to modify the schema of the `LINEAR_CREATE_LINEAR_ISSUE` action, we remove the parameters `project_id` and `team_id` as required fields, later in the program we will pass these values as inputs to the action manually. The technical term for this is **Schema Processing**. | ||
```typescript TypeScript | ||
const schemaProcessor: TSchemaProcessor = ({ |
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 adding a return type annotation for better type safety and documentation:
const schemaProcessor: TSchemaProcessor = ({
actionName,
toolSchema,
}: {
actionName: string;
toolSchema: RawActionData;
}): RawActionData => {
|
||
const agentExecutor = new AgentExecutor({ agent, tools, verbose: true }); | ||
|
||
const response = await agentExecutor.invoke({ input: "Create an issue on linear to update the frontend to with new design and description 'Refer to the design in the attachment', estimate is 5 (L) & return the issue id" }); |
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.
There's a minor grammatical error in the example task string: "to update the frontend to with new design" should be "to update the frontend with new design"
}) => { | ||
const modifiedParams = { ...params }; | ||
|
||
modifiedParams.project_id = "e708162b-9b1a-4901-ab93-0f0149f9d805"; |
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 extracting these IDs into constants at the top of the file or into a configuration object for better maintainability:
const LINEAR_CONFIG = {
PROJECT_ID: 'e708162b-9b1a-4901-ab93-0f0149f9d805',
TEAM_ID: '249ee4cc-7bbb-4ff1-adbe-d3ef2f3df94e'
} as const;
// Then in the preprocessor:
modifiedParams.project_id = LINEAR_CONFIG.PROJECT_ID;
modifiedParams.team_id = LINEAR_CONFIG.TEAM_ID;
Code Review SummaryOverall, this is a well-structured documentation update that adds valuable TypeScript examples alongside the existing Python documentation. The code examples are clear and follow good practices. Here's a detailed assessment: Strengths:✅ Well-organized documentation with clear step-by-step examples Suggestions for Improvement:
Code Quality Rating: 8/10The code is well-structured and follows TypeScript best practices, with room for minor improvements in error handling and type safety. Please address the comments I've left on specific lines. Once these are addressed, this will be a very solid addition to the documentation. |
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.
👍 Looks good to me! Incremental review on 8c8ca05 in 11 seconds
More details
- Looked at
13
lines of code in1
files - Skipped
0
files when reviewing. - Skipped posting
1
drafted comments based on config settings.
1. docs/patterns/tools/use-tools/processing-actions.mdx:194
- Draft comment:
Typo in key name 'successfull'. It should be 'successful'.
'success': output_data['successful'],
- Reason this comment was not posted:
Comment was not on a valid diff hunk.
Workflow ID: wflow_EvMaq2vKSQq1QvNf
You can customize Ellipsis with 👍 / 👎 feedback, review rules, user-specific overrides, quiet
mode, and more.
Important
Adds TypeScript examples for schema, input, and output processing in
processing-actions.mdx
.processing-actions.mdx
for schema, input, and output processing.LINEAR_CREATE_LINEAR_ISSUE
action schema, inputs, and outputs.This description was created by
for 8c8ca05. It will automatically update as commits are pushed.