mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-07 11:08:52 +01:00
❎ feat: Known Endpoint, xAI (#4632)
* feat: Known Endpoint, xAI * chore: update librechat-data-provider version to 0.7.53 * ci: name property removal * feat: add XAI_API_KEY to example environment variables
This commit is contained in:
parent
fc41032923
commit
3428c3c647
10 changed files with 22 additions and 12 deletions
|
|
@ -678,7 +678,6 @@ ${botMessage.message}
|
|||
|
||||
const instructionsPayload = {
|
||||
role: 'system',
|
||||
name: 'instructions',
|
||||
content: promptPrefix,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -553,7 +553,6 @@ class OpenAIClient extends BaseClient {
|
|||
promptPrefix = `Instructions:\n${promptPrefix.trim()}`;
|
||||
instructions = {
|
||||
role: 'system',
|
||||
name: 'instructions',
|
||||
content: promptPrefix,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -458,7 +458,6 @@ class PluginsClient extends OpenAIClient {
|
|||
|
||||
const instructionsPayload = {
|
||||
role: 'system',
|
||||
name: 'instructions',
|
||||
content: promptPrefix,
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -446,7 +446,7 @@ describe('OpenAIClient', () => {
|
|||
promptPrefix: 'Test Prefix',
|
||||
});
|
||||
expect(result).toHaveProperty('prompt');
|
||||
const instructions = result.prompt.find((item) => item.name === 'instructions');
|
||||
const instructions = result.prompt.find((item) => item.content.includes('Test Prefix'));
|
||||
expect(instructions).toBeDefined();
|
||||
expect(instructions.content).toContain('Test Prefix');
|
||||
});
|
||||
|
|
@ -476,7 +476,9 @@ describe('OpenAIClient', () => {
|
|||
const result = await client.buildMessages(messages, parentMessageId, {
|
||||
isChatCompletion: true,
|
||||
});
|
||||
const instructions = result.prompt.find((item) => item.name === 'instructions');
|
||||
const instructions = result.prompt.find((item) =>
|
||||
item.content.includes('Test Prefix from options'),
|
||||
);
|
||||
expect(instructions.content).toContain('Test Prefix from options');
|
||||
});
|
||||
|
||||
|
|
@ -484,7 +486,7 @@ describe('OpenAIClient', () => {
|
|||
const result = await client.buildMessages(messages, parentMessageId, {
|
||||
isChatCompletion: true,
|
||||
});
|
||||
const instructions = result.prompt.find((item) => item.name === 'instructions');
|
||||
const instructions = result.prompt.find((item) => item.content.includes('Test Prefix'));
|
||||
expect(instructions).toBeUndefined();
|
||||
});
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue