POST api/Village/{village}/AI/Proxy/Chat

Proxy to OpenAI Chat

Request Information

URI Parameters

NameDescriptionTypeAdditional information
village

string

None.

Body Parameters

Collection of AIChatMessageModel
NameDescriptionTypeAdditional information
role

Role

ChatMessageRole

None.

content

Content

string

None.

Request Formats

application/json, text/json

Sample:
[
  {
    "role": 0,
    "content": "sample string 1"
  },
  {
    "role": 0,
    "content": "sample string 1"
  }
]

application/xml, text/xml

Sample:
<ArrayOfAIChatMessageModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.Shared.Implementation.Models">
  <AIChatMessageModel>
    <content>sample string 1</content>
    <role>System</role>
  </AIChatMessageModel>
  <AIChatMessageModel>
    <content>sample string 1</content>
    <role>System</role>
  </AIChatMessageModel>
</ArrayOfAIChatMessageModel>

multipart/form-data

Sample:

Failed to generate the sample for media type 'multipart/form-data'. Cannot use formatter 'MultipartMediaTypeFormatter' to write type 'IEnumerable`1'.

Response Information

Resource Description

AIMessageModel
NameDescriptionTypeAdditional information
id

id

string

None.

role

role

ChatMessageRole

None.

content

content

string

None.

date

date

string

None.

isLoading

isLoading

boolean

None.

isError

isError

boolean

None.

Response Formats

application/json, text/json

Sample:
{
  "id": "sample string 1",
  "role": 0,
  "content": "sample string 2",
  "date": "sample string 3",
  "isLoading": true,
  "isError": true
}

application/xml, text/xml

Sample:
<AIMessageModel xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/CaringVillage.Shared.Implementation.Models">
  <content>sample string 2</content>
  <date>sample string 3</date>
  <id>sample string 1</id>
  <isError>true</isError>
  <isLoading>true</isLoading>
  <role>System</role>
</AIMessageModel>