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
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