RunContractResultGeneration
Generates contract review results by calling a large language model. The model returns review results, risk items, and suggested modifications for the contract. Specify the contract file ID, review stance, and review rules. The review results are returned incrementally through Server-Sent Events (SSE).
Operation description
Before using this operation, make sure that you fully understand the billing methods and pricing of the Farui product.
- This operation requires the activation of the pay-as-you-go service for the Farui product (activation is free). You can use the AccessKey and AccessSecret of the account to call the 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/result/genarate HTTP/1.1
Path Parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| workspaceId | string | Yes | The workspace ID on the Alibaba Cloud Model Studio platform. | llm-kqtrcpdee4xm29xc |
Request parameters
Parameter | Type | Required | Description | Example |
|---|---|---|---|---|
| appId | string | No | The application ID. | farui |
| stream | boolean | No | Specifies whether to use streaming output. | true |
| assistant | object | No | The agent. | |
| metaData | object | No | The agent metadata. To generate review results, provide at least one of the following: rules, ruleTaskId, or customRuleConfig.customRules. If all three are omitted, review results cannot be generated. | |
| customRuleConfig | object | No | The custom rule configuration. | |
| customRules | array<object> | No | List of custom rules | |
object | No | |||
| riskLevel | string | No | Rule risk level (high - high risk, medium - medium risk, low - low risk) | high |
| ruleDesc | string | No | Rule description | All contract clauses involving legal references, including but not limited to the governing law of the contract, dispute resolution mechanisms, compliance requirements, industry-specific regulations, and references to other legal obligations and rights. |
| ruleTitle | string | No | Rule title | Review the legality of contract terms |
| fileId | string | No | The file ID. | 9a6b1ba60d9944249363ec3cc1529b7b |
| position | string | No | The review stance. 0 = neutral, 1 = Party A, 2 = Party B. | 1 |
| ruleTaskId | string | No | The ID of the task that generates review rules. | b265b416-ca1f-425d-9340-c968f39624e1 |
| rules | array<object> | No | The list of model-generated rules. At least one rule is required. | |
object | No | The rule object. At least one is required. | ||
| riskLevel | string | No | Rule risk level (high - high risk, medium - medium risk, low - low risk) | medium |
| ruleSequence | string | No | Rule ordinal number | 2.1 |
| ruleTag | string | No | Rule tag (Type) | Review common risks in general terms |
| ruleTitle | string | No | Rule title | Review the risks related to statutory exemption circumstances in the contract's liability exemption clauses. |
| type | string | No | The agent type. | contract_examime |
| version | string | No | The agent version. | 1.0.0 |
Response elements
Element | Type | Description | Example |
|---|---|---|---|
object | Schema of Response | ||
| Code | string | The error code. | null |
| Message | string | The error message returned when the request fails. | null |
| Output | object | The output information. | |
| result | object | The contract review result. | |
| examineBrief | string | Overview of the review result | The contract does not clearly define statutory exemption clauses, especially the definition and consequences of force majeure, which may leave the rights and obligations of both parties unclear in the event of force majeure and therefore needs to be supplemented. |
| examineResult | string | Review conclusion | Needs modification |
| riskLevel | string | Rule risk level (high - high risk, medium - medium risk, low - low risk) | high |
| ruleSequence | string | The ordinal number of the rule corresponding to this review result | "1.1" |
| ruleTag | string | Rule tag corresponding to this review result | Review common risks in general terms |
| ruleTitle | string | Rule title corresponding to this review result | Review the risks related to statutory exemption circumstances in the contract's liability exemption clauses. |
| subRisks | array<object> | Risk sub-items of the review result | |
object | |||
| originalContent | string | The original contract text corresponding to the risk item | 14. Other agreed matters: |
| standardOriginalContent | string | This value is present only in contract comparison pattern | |
| resultContent | string | Modified text | 14.1 Force Majeure Clause 14.1.1 Definition of Force Majeure: refers to all events occurring after the signing of this agreement that are unforeseeable at the time of signing, whose occurrence and consequences cannot be avoided or overcome, and that prevent any party from fully or partially performing its obligations. Such events include but are not limited to earthquakes, typhoons, floods, fires, wars, international or domestic transportation disruptions, epidemics, strikes, and other events recognized as force majeure under Chinese law or general international commercial practice. 14.1.2 Consequences of Force Majeure: 14.1.2.1 If a force majeure event occurs that affects a party's performance of its obligations under this agreement, performance shall be suspended during the delay caused by the force majeure and shall not be considered a breach. 14.1.2.2 The party claiming that force majeure has occurred shall promptly notify the other parties in writing and, within fifteen (15) days thereafter, provide sufficient evidence proving the occurrence and duration of the force majeure. 14.1.2.3 If a force majeure event occurs, the parties shall immediately consult with each other to find a fair solution and shall make all reasonable efforts to minimize the impact of the force majeure. 14.1.2.4 Liability for delay in monetary obligations shall not be exempted due to force majeure. 14.1.2.5 Force majeure occurring during a delay in performance shall not have an exempting effect. |
| resultType | string | Recommendation for the risk item review result (requires modification / requires deletion / requires addition / Pass) | Requires modification |
| riskBrief | string | Risk brief | Failure to define force majeure and its consequences may leave both parties' rights unprotected when force majeure occurs. |
| riskClause | string | Name of the risk clause | Force majeure clause |
| riskExplain | string | Explanation of the risk point | Statutory exemption circumstances not clearly defined - force majeure |
| resultTaskId | string | The ID of the task that generates review results. | eaa56e1e-e205-4f5e-926e-5e2269ae7f68 |
| RequestId | string | The unique request ID generated by Alibaba Cloud. | 744419D0-671A-5997-9840-E8AE48356194 |
| Success | boolean | Indicates whether the call was successful. true: success. false: failure. | True |
| Usage | object | The usage of this call. | |
| input | integer | The number of input document pages. | 5 |
| unit | string | The unit. Fixed value: page. | page |
| httpStatusCode | string | The HTTP status code. | 200 |
Examples
Success response
JSON format
{
"Code": "null",
"Message": "null",
"Output": {
"result": {
"examineBrief": "合同中未明确法定免责条款,尤其是不可抗力的定义和后果,可能在发生不可抗力事件时导致双方权益不明,因此需要进行补充",
"examineResult": "需要修改",
"riskLevel": "high",
"ruleSequence": "\"1.1\"",
"ruleTag": "审查通用条款的常见风险",
"ruleTitle": "审查该合同免责条款中,法定免责情形审查相关的风险。",
"subRisks": [
{
"originalContent": "14. 其他约定事项:",
"standardOriginalContent": "",
"resultContent": "14.1 不可抗力条款14.1.1 不可抗力定义:指在本协议签署后发生的、本协议签署时不能预见的、其发生与后果是无法避免或克服的、妨碍任何一方全部或部分履约的所有事件。上述事件包括但不限于地震、台风、洪水、火灾、战争、国际或国内运输中断、流行病、罢工,以及根据中国法律或一般国际商业惯例认作不可抗力的其他事件。14.1.2 不可抗力的后果:14.1.2.1 如果发生不可抗力事件,影响一方履行其在本协议项下的义务,则在不可抗力造成的延误期内中止履行,而不视为违约。14.1.2.2 宣称发生不可抗力的一方应迅速书面通知其他各方,并在其后的十五(15)天内提供证明不可抗力发生及其持续时间的足够证据。14.1.2.3 如果发生不可抗力事件,各方应立即互相协商,以找到公平的解决办法,并且应尽一切合理努力将不可抗力的影响减少到最低限度。14.1.2.4 金钱债务的迟延责任不得因不可抗力而免除。14.1.2.5 迟延履行期间发生的不可抗力不具有免责效力。",
"resultType": "需修改",
"riskBrief": "未定义不可抗力及其后果,可能导致在发生不可抗力时,双方权益无法得到保障",
"riskClause": "不可抗力条款",
"riskExplain": "未明确法定免责情形—不可抗力"
}
]
},
"resultTaskId": "eaa56e1e-e205-4f5e-926e-5e2269ae7f68"
},
"RequestId": "744419D0-671A-5997-9840-E8AE48356194",
"Success": true,
"Usage": {
"input": 5,
"unit": "page"
},
"httpStatusCode": "200"
}
Error codes
Visit Error Center for more error codes.
Release notes
See Release Notes for a complete list.