caseflow
使用langchain 的LCEL语法来编排用例组成,每一步,每一个用例都是runnable对象。
每个步骤或用例都可使用 lanngchain的callbackmanager、retry等
每个自动化用例都可装饰成agent tool,供agent使用。此agent即为具有AI的RPA(Robotic Process Automation)。
用例采用接口录制har文件转接口自动化用例,并完成用例参数化。(todo: 此转换过程也可交由agent来自动转换)
安装
pip install caseflow
示例
import asyncio
from langchain_core.globals import set_verbose
from caseflow import CaseStep
from caseflow.run_case import parse_har
set_verbose(True)
stepJson_1 = parse_har("file/request.step_1.har")
stepJson_2 = parse_har("file/request.step_2.har")
flow = (
CaseStep(step_json_file_path=stepJson_1)
| CaseStep(step_json_file_path=stepJson_2)
)
# invoke
result = flow.invoke({})
print(result)
# ainvoke
result = asyncio.run(
flow.ainvoke(
{},
config={
"callbacks": [
# CaseStepStdOutCallbackHandler(),
]
},
)
)
print(result)
# stream
for chunk in flow.stream({}):
print(chunk)
# astream
async def stream_output():
async for chunk in flow.astream({}):
print(chunk)
asyncio.run(stream_output())
Metadata
Release files for caseflow 0.1.4
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| caseflow-0.1.4.tar.gz | 19.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| caseflow-0.1.4-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 42.6 kB
Release files / caseflow-0.1.4.tar.gz
| Download URL | caseflow-0.1.4.tar.gz |
|---|---|
| Size | 19.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
668d88a01d7204531fe735378a68931f0bc0895477474bfdc3127c3d806612d2
|
|
BLAKE2b-256 checksum How to use checksums |
99bbf4f0adf03ee7225523138f96cac0de4e4ad27c7b67d1bd5b6bd87dcb7066
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.17.1 CPython/3.12.4 Darwin/23.5.0
|
Release files / caseflow-0.1.4-py3-none-any.whl
| Download URL | caseflow-0.1.4-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4df680208f18610f7692fe7b0de93dc5abc3bd28084c04184c57a88b947c37ee
|
|
BLAKE2b-256 checksum How to use checksums |
09fd7ed636a20babf6c51a5574e8c09424684bc357421883a714acd7bedfe082
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.17.1 CPython/3.12.4 Darwin/23.5.0
|