-
Notifications
You must be signed in to change notification settings - Fork 194
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
Bash tool #233
Bash tool #233
Conversation
@gladyshcodes is attempting to deploy a commit to the Antiwork Team on Vercel. A member of the Team first needs to authorize it. |
A couple of things: |
Page extraction. To extract data such as bearers, I propose three solutions
const apiKey = await shortest.extract({
instruction: "extract API key“,
schema: z.object({
username: z.string(),
url: z.string(),
}),
});
const apiKey = await shortest(“extract API key”, new ExtractSchema{
schema: z.object({
username: z.string(),
url: z.string(),
}),
});
const keys = new FormData(); // uses shortest behind the hood
keys.set('bearer', ‘extract bearer token); This way we are embedding values directly in the test file memory rather than relying on conversational context Why: |
@slavingia Test cases with API requests that we would like to fully migrate to Shortest, in my opinion, have one drawback: API queries like that are super inconsistent and unstructured In this PR, I propose an Why: p.s This does not impact flexibility, as you can still create API test without using it. Also, hybrid approach is possible (first prompt argument will be in priority when assembling final command): const req = new APIRequest({
baseURL: "https://66ae07d8b18f3614e3b69165.mockapi.io/api",
extraHTTPHeaders: {
"Content-Type": "application/json",
},
timeout: 50000,
});
shortest(
"Ensure the API request is successful and returns 50 user objects. **Also, turn off cache control**",
req.fetch(
{
method: "GET",
headers: {
"Content-Type": "application/json",
Authorization: "<Bearer API KEY>",
},
},
{
maxRetries: 3,
}
)
); |
Had a chance to refactor |
I am unable to test the functionality in the final test file of #226. I'm encountering this issue when trying to create an organization at Iffy: @slavingia Could you please assist me with that? |
It may be good to add an endpoint within shortest and test for that so we can have it as part of this repo's tests/CI? |
Done! |
So this thing is R4R Please take a look @slavingia @m2rads |
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.
Minor comments. We should update the README.
@slavingia README updated |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
Would be good to have an example within this repo itself, somewhere in here: https://github.com/anti-work/shortest/tree/main/app/api Of a test. I'd also think we'd want to take advantage of the "after" async page block thingy so we can verify the output more specifically, than just "valid users" – how does the QA AI/person know that the specific users were listed appropriately, and none that should be hidden, aren't shown (e.g. the app allows one to have a deleted user, that may still show up)? |
Not sure what you mean by 'putting examples into the repo itself'. We now have three more working tests in examples/api-failure.test.ts Have you seen them? README example is made up, we do not have such test in our codebase |
My bad, I missed those. |
Looks solid. Let's have these tests in the |
Issue #226
This PR introduces a Bash tool that enables using Shortest for API testing