Replay the interface recording packets, orchestrate and run them based on the LCEL using the langChain.
Project description
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())
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file caseflow-0.1.4.tar.gz.
File metadata
- Download URL: caseflow-0.1.4.tar.gz
- Upload date:
- Size: 19.6 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.17.1 CPython/3.12.4 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
668d88a01d7204531fe735378a68931f0bc0895477474bfdc3127c3d806612d2
|
|
| MD5 |
5afbaa942ecc07003dc9f22d38503c72
|
|
| BLAKE2b-256 |
99bbf4f0adf03ee7225523138f96cac0de4e4ad27c7b67d1bd5b6bd87dcb7066
|
File details
Details for the file caseflow-0.1.4-py3-none-any.whl.
File metadata
- Download URL: caseflow-0.1.4-py3-none-any.whl
- Upload date:
- Size: 22.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.17.1 CPython/3.12.4 Darwin/23.5.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4df680208f18610f7692fe7b0de93dc5abc3bd28084c04184c57a88b947c37ee
|
|
| MD5 |
c45f639bf7c23e0da0fcde7687f20e28
|
|
| BLAKE2b-256 |
09fd7ed636a20babf6c51a5574e8c09424684bc357421883a714acd7bedfe082
|