Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chat: smoother api context default (fixes #7571) #7572

Merged
merged 5 commits into from
Sep 20, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading