arcee-python
arcee-python copied to clipboard
Set up openapi spec
https://github.com/openapi-generators/openapi-python-client
Was able to generate an API client with this invoke task:
@task
def codegen(ctx: Context, openapi_url: Optional[str] = "https://app.arcee.ai/api/openapi.json") -> None:
"""codegen
Generate code from Arcee's OpenAPI spec
"""
ctx.run(
"uv pip install --upgrade openapi-python-client",
pty=True,
echo=True,
)
ctx.run(
f"openapi-python-client generate --url {openapi_url} \
--meta none \
--overwrite \
--no-fail-on-warning \
--config openapi-config.yml \
--output-path arcee/codegen",
pty=True,
echo=True,
)
# Format the generated code
ctx.run(
"black arcee/codegen",
pty=True,
echo=True,
)
ctx.run(
"ruff check arcee/codegen --fix --fix-only",
pty=True,
echo=True,
)
Oh sorry @nason, I didn't realize this was still active! I only looked at the date of the initial comment and assumed it was dead, but now I see your comment was from last week.
(was just trying to clean up the inactive issues a bit)