Skip to content

Commit

Permalink
chat: smoother api context default (fixes #7571) (#7572)
Browse files Browse the repository at this point in the history
Co-authored-by: dogi <[email protected]>
  • Loading branch information
Mutugiii and dogi authored Sep 20, 2024
1 parent 9b1294b commit c17d14c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion chatapi/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,8 @@ In the production environment these configs are set in the `planet.yml` file.
"data": {
"user": "admin",
"content": "Hello",
"assistant": true,
"assistant": false,
"context": "",
"aiProvider": {
"name": "openai",
"model"?: "gpt-3.5-turbo",
Expand All @@ -76,6 +77,7 @@ In the production environment these configs are set in the `planet.yml` file.
- **user**: string(required) -> Provide the planet/myPlanet username
- **content**: string(required) -> The latest prompt for the AI to answer
- **assistant**: boolean(required) -> Set to true if you want to use the assistants endpoint
- **context**: string(optional) -> The text context you would like to pre-load the AI Assistant with
- **aiProvider**: Object(required)
- **name**: string(required) -> Name of the API provider to choose from i.e openai, perplexity or gemini.
- **model**: string(optional) -> Name of the specific provider model to use. Defaults to gpt-3.5-turbo for _openai_, llama-3-sonar-small-32k-online for _peplexity_ and gemini-pro for _google gemini_
Expand Down
2 changes: 1 addition & 1 deletion chatapi/src/utils/chat-helpers.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export async function aiChatNonStream(
messages: ChatMessage[],
aiProvider: AIProvider,
assistant: boolean,
context: any,
context: any = '',
): Promise<string> {
const provider = models[aiProvider.name];
if (!provider) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "planet",
"license": "AGPL-3.0",
"version": "0.14.76",
"version": "0.14.77",
"myplanet": {
"latest": "v0.19.33",
"min": "v0.18.33"
Expand Down

0 comments on commit c17d14c

Please sign in to comment.