Skip to content

Commit

Permalink
Release: 0.5.3 (#599)
Browse files Browse the repository at this point in the history
* release: 0.5.3, add extra linting rule and minor fix for EndpointDialog

* chore: revert to deprecated Message Classes as weird behavior seen in linux

* chore(api): remove unused test scripts
chore(package.json): remove unused langchain dependency

* chore(.gitignore): add /images directory to the ignore list
  • Loading branch information
danny-avila authored Jul 7, 2023
1 parent 69d192b commit 2607f15
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 289 deletions.
1 change: 1 addition & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ module.exports = {
}
],
'linebreak-style': 0,
'object-curly-spacing': ['error', 'always'],
'no-trailing-spaces': 'error',
'no-multiple-empty-lines': ['error', { 'max': 1 }],
// "arrow-parens": [2, "as-needed", { requireForBlockBody: true }],
Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -75,3 +75,4 @@ data.ms/*
auth.json

/packages/ux-shared/
/images
2 changes: 1 addition & 1 deletion api/app/clients/OpenAIClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ class OpenAIClient extends BaseClient {
// TODO: need to handle interleaving instructions better
if (this.contextStrategy) {
({ payload, tokenCountMap, promptTokens, messages } =
await this.handleContextStrategy({instructions, orderedMessages, formattedMessages}));
await this.handleContextStrategy({ instructions, orderedMessages, formattedMessages }));
}

const result = {
Expand Down
6 changes: 3 additions & 3 deletions api/app/clients/PluginsClient.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ const { CallbackManager } = require('langchain/callbacks');
const { initializeCustomAgent, initializeFunctionsAgent } = require('./agents/');
const { loadTools } = require('./tools/util');
const { SelfReflectionTool } = require('./tools/');
const { HumanMessage, AIMessage } = require('langchain/schema');
const { HumanChatMessage, AIChatMessage } = require('langchain/schema');
const {
instructions,
imageInstructions,
Expand Down Expand Up @@ -237,8 +237,8 @@ Only respond with your conversational reply to the following User Message:
// Map Messages to Langchain format
const pastMessages = this.currentMessages.slice(0, -1).map(
msg => msg?.isCreatedByUser || msg?.role?.toLowerCase() === 'user'
? new HumanMessage(msg.text)
: new AIMessage(msg.text));
? new HumanChatMessage(msg.text)
: new AIChatMessage(msg.text));

// initialize agent
const initializer = this.functionsAgent ? initializeFunctionsAgent : initializeCustomAgent;
Expand Down
10 changes: 2 additions & 8 deletions api/package.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,12 @@
{
"name": "@librechat/backend",
"version": "0.5.2",
"version": "0.5.3",
"description": "",
"scripts": {
"start": "echo 'please run this from the root directory'",
"server-dev": "echo 'please run this from the root directory'",
"test": "cross-env NODE_ENV=test jest",
"test:ci": "jest --ci",
"test2": "node --inspect app/langchain/test2.js",
"test3": "node --inspect app/langchain/test3.js",
"test4": "node --inspect app/langchain/test4.js",
"test5": "node --inspect app/langchain/test5.js",
"test8": "node --inspect app/langchain/test8.js",
"langchain": "node app/langchain/test2.js"
"test:ci": "jest --ci"
},
"repository": {
"type": "git",
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@librechat/frontend",
"version": "0.5.2",
"version": "0.5.3",
"description": "",
"scripts": {
"data-provider": "cd .. && npm run build:data-provider",
Expand Down
15 changes: 3 additions & 12 deletions client/src/components/Endpoints/EndpointOptionsDialog.jsx
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
import exportFromJSON from 'export-from-json';
import { useEffect, useState } from 'react';
import { useRecoilValue } from 'recoil';
import { Dialog, DialogButton, DialogTemplate } from '~/components/';
import { Dialog, DialogButton, DialogTemplate } from '~/components';
import SaveAsPresetDialog from './SaveAsPresetDialog';
import cleanupPreset from '~/utils/cleanupPreset';

import { alternateName } from '~/utils';
import Settings from './Settings';

import store from '~/store';

// A preset dialog to show readonly preset values.
const EndpointOptionsDialog = ({ open, onOpenChange, preset: _preset, title }) => {
const [preset, setPreset] = useState(_preset);
const [endpointName, setEndpointName] = useState(preset?.endpoint);

const [saveAsDialogShow, setSaveAsDialogShow] = useState(false);
const endpointsConfig = useRecoilValue(store.endpointsConfig);

if (endpointName === 'google') {
setEndpointName('PaLM');
}

if (endpointName === 'gptPlugins') {
setEndpointName('Plugins');
}
const endpointName = alternateName[preset?.endpoint] ?? 'Endpoint';

const setOption = (param) => (newValue) => {
let update = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState }from 'react';
import React, { useState } from 'react';
import HelpText from './HelpText';
import GoogleConfig from './GoogleConfig';
import OpenAIConfig from './OpenAIConfig';
Expand Down
Loading

0 comments on commit 2607f15

Please sign in to comment.