---
# System prepended metadata

title: SRP GenAI API 格式 (2024/07/12)

---

# SRP GenAI API 格式 (2024/07/12)

[TOC]
SRP: solution ready package

## SRP GenAI API
#### **[POST]** /genai/srp/store

<details><summary><sup>Request</sup></summary>

```jsonld
{
    "embeddings": "text-embedding-ada-002",
    "function": "fault_reason_analysis",
    "files": "upload_a_file",
    "model_name": "panasonic"
    "descriptions": "string",
    "instructions": "string",
    "info_keys": ["error_code","error_info"]
}
```
</details>

<details><summary><sup>Response</sup></summary>
    
```jsonld
# Success ->
{
    "errCode": 200,
    "data": str
}
    
# Validation Error ->    
{  
    "errCode": 422,
    "data": str #Error message
}
```
</details>

#### **[POST]** /genai/srp/retrieve

<details><summary><sup>Request</sup></summary>

```jsonld
{
  "messages": [
    {
      "role": "user",
      "content": "請提供错误原因,检查和对策給我"
    }
  ],
  "params": {
    "function": "fault_reason_analysis",
    "model_name": "panasonic",
    "info": {
        "error_code": "40001",
        "error_info": "紧急停止开关打开"}
  }
}
```
</details>

<details><summary><sup>Response</sup></summary>
    
```jsonld
# Success ->
{
    "errCode": 200,
    "data": str
}
    
# Validation Error ->    
{  
    "errCode": 422,
    "data": str #Error message
}
```
</details>

