RunLegalAdviceConsultation
Provides legal consultation services.
Operation description
Before using this API, make sure that you fully understand the billing methods and pricing of the Farui product.
- This API requires activation of the pay-as-you-go service for Farui products (activation is free of charge). You can use the AccessKey and AccessSecret of this account to call our OpenAPI service.
- The service response is returned as a stream through Server-Sent Events (SSE).
- Calling this API requires workspace permissions on the Alibaba Cloud Model Studio platform.
Debugging
You can run this API directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After a successful run, OpenAPI Explorer can automatically generate SDK code examples.
Authorization information
No authorization information is available for this API.
Request syntax
POST /{workspaceId}/farui/legalAdvice/consult HTTP/1.1
Request parameters
| Name | Type | Required | Description | Example |
|---|---|---|---|---|
| appId | string | No | The application ID. Valid values:
| farui |
| stream | boolean | No | Specifies whether the request is a streaming request. Valid values:
| true |
| workspaceId | string | No | The workspace ID of Alibaba Cloud Model Studio. | llm-9w5y60lseff0jiqm |
| assistant | object | No | The agent. | |
| id | string | No | The agent ID. | assitant_abc_123 |
| metaData | object | No | The agent metadata. | |
| string | No | Custom meta information. | meta | |
| type | string | No | The agent type. | legal_advice_consult |
| version | string | No | The agent version. | 1.0.0 |
| thread | object | No | The thread. | |
| messages | array<object> | No | The request context. | |
| object | No | |||
| content | string | No | The conversation content. | A friend borrowed 100,000 yuan from me and agreed to repay it within two months without interest. More than half a year has passed and he still has not repaid. Can I demand additional interest? |
| role | string | No | The role in the conversation. Valid values:
| user |
| extra | object | No | Settings related to deep thinking. If this parameter is not specified, the response of the previous version is returned. | |
| deepThink | boolean | No | Specifies whether to enable deep thinking. | true |
| onlineSearch | boolean | No | Specifies whether to perform an online search. | true |
Response parameters
| Name | Type | Description | Example |
|---|---|---|---|
| object | Schema of Response | ||
| Code | string | The error code. | null |
| Message | string | If the request is abnormal, the specific error message is returned. | null |
| RequestId | string | The unique identifier generated by Alibaba Cloud for the request. | 744419D0-671A-5997-9840-E8AE48356194 |
| ResponseMarkdown | string | The response answer. This is returned for non-deep thinking requests. | In the lending relationship between you and your friend, the specific calculation method can refer to the one-year Loan Prime Rate (LPR) or be determined based on the principles of fairness and good faith. If negotiation fails, you may protect your rights through legal proceedings. Before taking action, it is recommended to consult a professional legal advisor for more specific legal advice. |
| Round | integer | The current request round. | 1 |
| Status | string | The response status. | Answering |
| Success | boolean | Indicates whether the call was successful. true: The call was successful. false: The call failed. | True |
| contents | string | The deep thinking response consists of three parts, each identified by the type field. The type=deepThink part contains the deep thinking results. The type=text part contains the answer. The type=referenceList part contains references such as case law, regulations, and online resources. These references include caseList (cases), lawList (regulations), and searchList (online resources, available only when the online search feature is enabled). | [{"id":"50b231e343f348209023259575cf5be7","contentType":"deepThink","content":"OK, the user is asking about the legal risks to be aware of when posting photos of others on social media. First, I need to review the materials provided by Farui and look at relevant legal provisions and cases.\n\nFirst, I think of the portrait rights provisions in the Civil Code,","status":"stop"},{"searchList":[],"lawList":[{"lawId":"f6a8ac8d16677fe501ccabd235d77229","lawItemId":"8a838a988a5ec2aee647e7296a602966"}","caseList":["(2020) Xiang 0281 Min Chu No. 3082"},{"id":"50b231e343f348209023259575cf5be7","contentType":"text","content":"When posting photos of others on social media, note the following legal risks and response measures.","status":"Generating answer for you..."}] |
| extra | string | The search type information entered by the user. | "{\"deepThink\":true,\"onlineSearch\":true}" |
| Usage | object | The usage of this call. | |
| InputTokens | integer | The number of tokens used for the input. | 500 |
| OutputTokens | integer | The number of tokens used for the output. | 700 |
| TotalTokens | integer | The total number of tokens used for this call. | 1200 |
| httpStatusCode | string | The HTTP status code. | 200 |
Examples
Success response
JSON format
{
"Code": null,
"Message": null,
"RequestId": "744419D0-671A-5997-9840-E8AE48356194",
"ResponseMarkdown": "在您与朋友之间的借贷关系中,具体的计算方法可以参照一年期贷款市场报价利率(LPR)或根据公平原则和诚实信用原则确定。如协商不成,您可以通过法律诉讼途径维护自己的权益。在行动前,建议咨询专业法律人士以获取更具体的法律建议。\n",
"Round": 1,
"Status": "正在回答",
"Success": true,
"contents": "[{\"id\":\"50b231e343f348209023259575cf5be7\",\"contentType\":\"deepThink\",\"content\":\"好的,用户问的是在社交媒体上发布他人照片需要注意哪些法律风险。首先,我需要回顾法睿提供的资料,看看相关的法律条文和案例。\\n\\n首先想到的是民法典里的肖像权规定,\",\"status\":\"stop\"},{\"searchList\":[],\"lawList\":[{\"lawId\":\"f6a8ac8d16677fe501ccabd235d77229\",\"lawItemId\":\"8a838a988a5ec2aee647e7296a602966\"}\",\"caseList\":[\"(2020)湘0281民初3082号\"},{\"id\":\"50b231e343f348209023259575cf5be7\",\"contentType\":\"text\",\"content\":\"在社交媒体上发布他人照片需注意以下法律风险及应对措施,。\",\"status\":\"正在为您生成回答...\"}]\n",
"extra": {
"deepThink": true,
"onlineSearch": true
},
"Usage": {
"InputTokens": 500,
"OutputTokens": 700,
"TotalTokens": 1200
},
"httpStatusCode": 200
}
Error codes
Visit the Error Center to view more error codes.