An agent can have pre- or post-processing. This is the logic called before or after the execution of a Cairo program. This is useful for not transmitting or returning a large and complex data structure in the Cairo program, but only the data that the Cairo program needs to perform the verifiable computation.
Pre/post-processing was added by Gonzalo on OrionRunner. However, when developing an agent, we should avoid using OrionRunner as it's adding overhead in the DX. This PR introduces the pre/post-processing mechanism in cairo-hints.
If you pass --preprocess or --postprocess flags, scarb hints-run will run the respective endpoints. By default, these endpoints are localhosts, but you can change them with env variables PREPROCESS_URL and POSRPROCESS_URL.
The pre-processing input is a JSON string, which you pass with --args_json.
This way, you can E2E-test your agent directly with scarb hints.
An agent can have pre- or post-processing. This is the logic called before or after the execution of a Cairo program. This is useful for not transmitting or returning a large and complex data structure in the Cairo program, but only the data that the Cairo program needs to perform the verifiable computation.
Pre/post-processing was added by Gonzalo on OrionRunner. However, when developing an agent, we should avoid using OrionRunner as it's adding overhead in the DX. This PR introduces the pre/post-processing mechanism in cairo-hints.
If you pass
--preprocess
or--postprocess
flags,scarb hints-run
will run the respective endpoints. By default, these endpoints are localhosts, but you can change them with env variablesPREPROCESS_URL
andPOSRPROCESS_URL
.The pre-processing input is a JSON string, which you pass with
--args_json
.This way, you can E2E-test your agent directly with scarb hints.