RunContractRuleGeneration

Updated at:

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.

Debug

RAM authorization

No authorization information is currently available for this API.

Request syntax

POST /{workspaceId}/farui/contract/rule/genarate HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample value
appIdstringNo

Application ID

farui
streambooleanNo

Whether to use streaming output

true
workspaceIdstringNo

Workspace ID on the Alibaba Cloud Model Studio platform

llm-9w5y60lseff0jiqm
assistantobjectNo

Agent

metaDataobjectNo

Agent metadata

fileIdstringNo

File ID.

9a6b1ba60d9944249363ec3cc1529b7b
positionstringNo

Review stance, 0 = neutral, 1 = Party A, 2 = Party B

1
typestringNo

Agent type

contract_examime
versionstringNo

Agent version

1.0.0

Response elements

NameTypeDescriptionExample value
object

Schema of Response

Codestring

Error code

null
Messagestring

The error message returned if the request fails.

null
Outputobject

Output information

ruleTaskIdstring

ID of the rule generation task

b265b416-ca1f-425d-9340-c968f39624e9
rulesarray<object>

Rules generated by the model (returned incrementally)

rulesobject
riskLevelstring

Rule risk level (high - high risk, medium - medium risk, low - low risk)

medium
ruleSequencestring

Rule ordinal number

1.1
ruleTagstring

Rule tag (type)

Legality review of contract terms
ruleTitlestring

Rule title

Risks related to the legality of the subject matter in the contract terms
RequestIdstring

The unique identifier generated by Alibaba Cloud for this request.

744419D0-671A-5997-9840-E8AE48356194
Successboolean

Indicates whether the call was successful. true: success. false: failure.

True
Usageobject

Usage of this call (contract review is billed by page)

inputlong

Number of pages in the input document

5
unitstring

Unit (fixed value: page)

page
httpStatusCodeinteger

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.