RunLegalAdviceConsultation

Updated at:

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.

Debug

Authorization information

No authorization information is available for this API.

Request syntax

POST /{workspaceId}/farui/legalAdvice/consult HTTP/1.1

Request parameters

NameTypeRequiredDescriptionExample
appIdstringNo

The application ID.

Valid values:
  • farui: farui.
farui
streambooleanNo

Specifies whether the request is a streaming request.

Valid values:
  • true: true.
  • false: false.
true
workspaceIdstringNo

The workspace ID of Alibaba Cloud Model Studio.

llm-9w5y60lseff0jiqm
assistantobjectNo

The agent.

idstringNo

The agent ID.

assitant_abc_123
metaDataobjectNo

The agent metadata.

stringNo

Custom meta information.

meta
typestringNo

The agent type.

legal_advice_consult
versionstringNo

The agent version.

1.0.0
threadobjectNo

The thread.

messagesarray<object>No

The request context.

objectNo
contentstringNo

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

The role in the conversation.

Valid values:
  • assistant: The assistant.
  • system: The system.
  • user: The user.
user
extraobjectNo

Settings related to deep thinking. If this parameter is not specified, the response of the previous version is returned.

deepThinkbooleanNo

Specifies whether to enable deep thinking.

true
onlineSearchbooleanNo

Specifies whether to perform an online search.

true

Response parameters

NameTypeDescriptionExample
object

Schema of Response

Codestring

The error code.

null
Messagestring

If the request is abnormal, the specific error message is returned.

null
RequestIdstring

The unique identifier generated by Alibaba Cloud for the request.

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

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

The current request round.

1
Statusstring

The response status.

Answering
Successboolean

Indicates whether the call was successful. true: The call was successful. false: The call failed.

True
contentsstring

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..."}]
extrastring

The search type information entered by the user.

"{\"deepThink\":true,\"onlineSearch\":true}"
Usageobject

The usage of this call.

InputTokensinteger

The number of tokens used for the input.

500
OutputTokensinteger

The number of tokens used for the output.

700
TotalTokensinteger

The total number of tokens used for this call.

1200
httpStatusCodestring

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.