Skip to main content

ace-py

概要

ace-py は来栖川電算の CLI 型 AI エージェント ACE を Python から簡単に利用するためのラッパーライブラリです。

インストール

リポジトリ名は ace-py ですが、PyPI上のパッケージ名は ace-client です。インストール時はパッケージ名にご注意ください。

pip install ace-client

または uv を使用する場合:

uv add ace-client

使用例

簡単な使用例です。環境変数 OPENAI_API_KEY に API キーを入れて実行します。

import asyncio
import os

import msgspec

from ace_client import Ace


class Response(msgspec.Struct):
    answer: str


async def main() -> None:
    api_key = os.environ.get("OPENAI_API_KEY", "")
    if not api_key:
        print("環境変数 OPENAI_API_KEY を設定してください", file=sys.stderr)
        sys.exit(1)

    ace = Ace(api_key=api_key)

    try:
        # 30秒のタイムアウトを設定してACEを呼び出す
        # イベントをトリガーにしてキャンセルしたい場合はTaskGroup等を使用して明示的にキャンセルを呼び出してください
        async with asyncio.timeout(30):
            result = await ace.invoke(
                config_path="example/simple.yaml",
                agent_name="root",
                input_data={"question": "今日の名古屋の天気は?"},
            )
            response = result.unmarshal(Response)
            print(response.answer)

    except Exception as e:
        print(f"エラーが発生しました: {e}", file=sys.stderr)
        sys.exit(1)


if __name__ == "__main__":
    asyncio.run(main())

ライセンス

MIT License

Metadata

Release files for ace-client 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ace-client 0.1.2
File Size Uploaded Provenance Actions
ace_client-0.1.2.tar.gz 4.9 kB Without provenance Details for ace_client-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for ace-client 0.1.2
File Interpreter ABI Platform Actions
ace_client-0.1.2-py3-none-any.whl Python 3 none any Details for ace_client-0.1.2-py3-none-any.whl

Total release size: 11.3 kB

Release files / ace_client-0.1.2.tar.gz

Download URL ace_client-0.1.2.tar.gz
Size 4.9 kB
Tags Source
SHA-256 checksum
How to use checksums
5b5cf8034a8bb2a08e4e192b5f8d2b9271298b4c2e8065f69feaf7f9183dd65b
BLAKE2b-256 checksum
How to use checksums
7b4b72fbac35a9be7bc40928d3131a1a06ab7d2b2f51e9f6d806db83fd884293
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.0

Release files / ace_client-0.1.2-py3-none-any.whl

Download URL ace_client-0.1.2-py3-none-any.whl
Size 6.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
64dfe74ad319c5c4178611052c558a30be5a33bae6921e5829da48c02ec82dcb
BLAKE2b-256 checksum
How to use checksums
c9de570ae77f841a6fa3285cc10338990995aa1c292ca415e1fc8a0d266df10a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.6.0

Security for ace-client 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page