RunContractRuleGeneration
This operation uses a Large Language Model (LLM) to generate intelligent contract review rules. It returns the generated rules and associated threats for a specified contract. You provide the contract file ID and the review stance. The model returns results incrementally using Server-Sent Events (SSE).
Operation description
Make sure that you fully understand the billing method and pricing of the FaRui product before you use this operation.
- This operation requires you to activate the pay-as-you-go service for the FaRui product (activation is free of charge). You can use the AccessKey and AccessSecret of this account to call our OpenAPI service.
- The response is returned in streaming mode through Server-Sent Events (SSE).
- Calling this operation requires workspace permissions on the Alibaba Cloud Model Studio platform.
Try it now
You can run this operation directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
RAM authorization
No authorization information is currently available for this API.
Request syntax
POST /{workspaceId}/farui/contract/rule/genarate HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example value |
|---|---|---|---|---|
| appId | string | No | Application ID | farui |
| stream | boolean | No | Whether to use streaming output | true |
| workspaceId | string | No | Workspace ID on the Alibaba Cloud Model Studio platform | llm-9w5y60lseff0jiqm |
| assistant | object | No | Agent | |
| metaData | object | No | Agent metadata | |
| fileId | string | No | File ID. | 9a6b1ba60d9944249363ec3cc1529b7b |
| position | string | No | Review stance, 0 = neutral, 1 = Party A, 2 = Party B | 1 |
| type | string | No | Agent type | contract_examime |
| version | string | No | Agent version | 1.0.0 |
Response elements
| Name | Type | Description | Example value |
|---|---|---|---|
| object | Schema of Response | ||
| Code | string | Error code | null |
| Message | string | The error message returned if the request fails. | null |
| Output | object | Output information | |
| ruleTaskId | string | ID of the rule generation task | b265b416-ca1f-425d-9340-c968f39624e9 |
| rules | array<object> | Rules generated by the model (returned incrementally) | |
| rules | object | ||
| riskLevel | string | Rule risk level (high - high risk, medium - medium risk, low - low risk) | medium |
| ruleSequence | string | Rule ordinal number | 1.1 |
| ruleTag | string | Rule tag (type) | Legality review of contract terms |
| ruleTitle | string | Rule title | Risks related to the legality of the subject matter in the contract terms |
| RequestId | string | The unique identifier generated by Alibaba Cloud for this request. | 744419D0-671A-5997-9840-E8AE48356194 |
| Success | boolean | Indicates whether the call was successful. true: success. false: failure. | True |
| Usage | object | Usage of this call (contract review is billed by page) | |
| input | long | Number of pages in the input document | 5 |
| unit | string | Unit (fixed value: page) | page |
| httpStatusCode | integer | HTTP status code | 200 |
Examples
Success response
JSON format
{
"Code": null,
"Message": null,
"Output": {
"ruleTaskId": "b265b416-ca1f-425d-9340-c968f39624e9",
"rules": [
{
"riskLevel": "medium",
"ruleSequence": 1.1,
"ruleTag": "审查条款的合法性",
"ruleTitle": "审查该合同标的条款中,标的合法性相关的风险"
}
]
},
"RequestId": "744419D0-671A-5997-9840-E8AE48356194",
"Success": true,
"Usage": {
"input": 5,
"unit": "page"
},
"httpStatusCode": 200
}
Error codes
Visit the Error Center to view more error codes.