Skip to content

Commit

Permalink
fix(docs): correct custom request format documentation
Browse files Browse the repository at this point in the history
- Clarify the number of request parameters supported and the compatibility of messageKey with OpenAI.
- Update the example of custom request format to include the correct syntax for custom fields and headers.
- Add an example of how to use custom headers and fix the Moonshot AI example link.
  • Loading branch information
phodal committed Mar 1, 2024
1 parent 089afdc commit c8ad270
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions docs/customize/custom-llm-server.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,15 +71,14 @@ $.choices[0].message.delta.content

## Custom request format

Only support amount of request parameters like OpenAI does.
Only support http request that don't need encryption keys(like websocket)

Only support number of request parameters like OpenAI does.
Only support http request that doesn't need encryption keys(like websocket)

### Custom Request (header/body/message-keys)

**BE CAREFUL: In this project, messageKey is not compatible with openAI: messageKeys: `{ { "content": "content" } }`is REQUIRED** *maybe we will fix this in the future.*

If your llm server has custom request format, you can:
If your llm server has a custom request format, you can:

- Add top level field to the request body via `customFields`
- Add custom headers to the request via `customHeaders`
Expand All @@ -91,7 +90,7 @@ For example:
{ "customFields": {"user": "12345", "model":"model-name", "stream": true}, "messageKeys": { "content": "content" }}
```


Or with custom headers:

```json
{
Expand Down Expand Up @@ -125,7 +124,7 @@ And the request body will be:
}
```

### Moonshot AI example
### Moonshot AI examples

Official Moonshot AI doc: https://platform.moonshot.cn/docs/api-reference

Expand Down Expand Up @@ -165,4 +164,4 @@ Response format:

```
$.choices[0].delta.content
```
```

0 comments on commit c8ad270

Please sign in to comment.