Repository navigation
Add ai/agent command and --api-url option - #29
Merged
Merged
Conversation
- ai/agent (aliases ai-agent, agent, ai): an AI agent processes the files as described in --prompt, with the model set by --engine (beta). Files are optional if the prompt names the files to import. The export ignores a missing agent output, so an answered question does not fail the job; the answer and the suggestions of the agent are printed. Failed tasks created by the agent are logged as info, as the agent may correct them. - --api-url / CLOUDCONVERT_API_URL sends the API calls to another endpoint, such as a local development server. The socket is expected on the socketio. host of the API.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
ai/agentcommand (beta)Adds the new
ai/agenttask: an AI agent processes files as described in plain language.ai-agent,agent,ai.--promptis required,--enginesets the model (cloudconvert parameters ai/agent --alternativeslists them).No files found: …) instead of silently sending a prompt-only job.ignore_error: true: when the agent answers a question without output files, the API cancels the export withAGENT_NO_OUTPUT, which would otherwise fail the job. That cancellation message is not printed.suggestions.parent_task_idset) are logged as info while the job runs, since the agent may correct them. The final summary of a failed job still lists them as errors.--api-url/CLOUDCONVERT_API_URLSends the API calls to another endpoint, such as a local development server; overrides
--sandbox. The SDK has the production and sandbox URLs built in, so this subclasses it, overridingcall()and opening the socket on thesocketio.host of the API URL (as forapi.cloudconvert.com).socket.io-clientis now a direct dependency for that; it was already installed through the SDK.Testing
npm run typecheck,npm test(49 tests, 10 new).https://api.cloudconvert.localhost):credits,parameters ai/agent --alternatives, a question job with an uploaded PDF (cancelled with Ctrl+C while queued), and a prompt-only job that imported a PDF from a URL and downloaded all 31 PNGs.Notes for review
ai/agentis not available on the production and sandbox APIs yet. Until it is,parameters ai/agentprints the whole operations catalog, because the API ignores unknownfilter[operation]values. This should ship after the API.--api-urlis not mentioned in the README; it shows up in--help.