mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-10-25 03:32:12 +00:00
🧊 fix: Include Conversation Starters in Agent View and List Responses (#14142)
* fix: include conversation_starters in agent view and list responses * test: cover conversation_starters in agent view and list projections * test: include conversation_starters in agent list whitelist --------- Co-authored-by: Danny Avila <danny@librechat.ai>
This commit is contained in:
parent
96367828e1
commit
96d213afe6
4 changed files with 45 additions and 0 deletions
|
|
@ -543,6 +543,7 @@ const getAgentHandler = async (req, res, expandProperties = false) => {
|
|||
id: agent.id,
|
||||
name: agent.name,
|
||||
description: agent.description,
|
||||
conversation_starters: agent.conversation_starters,
|
||||
avatar: agent.avatar,
|
||||
author: agent.author,
|
||||
provider: agent.provider,
|
||||
|
|
|
|||
|
|
@ -634,6 +634,27 @@ describe('Agent Controllers - Mass Assignment Protection', () => {
|
|||
});
|
||||
expect(response.owner_contact).toBeUndefined();
|
||||
});
|
||||
|
||||
test('should include conversation_starters in the basic VIEW response', async () => {
|
||||
const starters = ['Summarize this page', 'What can you do?'];
|
||||
const agent = await Agent.create({
|
||||
id: `agent_${uuidv4()}`,
|
||||
name: 'Starter Agent',
|
||||
description: 'Exposes conversation starters',
|
||||
provider: 'openai',
|
||||
model: 'gpt-4',
|
||||
author: mockReq.user.id,
|
||||
conversation_starters: starters,
|
||||
});
|
||||
|
||||
mockReq.params = { id: agent.id };
|
||||
|
||||
await getAgentHandler(mockReq, mockRes);
|
||||
|
||||
expect(mockRes.status).toHaveBeenCalledWith(200);
|
||||
const response = mockRes.json.mock.calls[0][0];
|
||||
expect(response.conversation_starters).toEqual(starters);
|
||||
});
|
||||
});
|
||||
|
||||
describe('getAgentVersionsHandler', () => {
|
||||
|
|
@ -1625,6 +1646,7 @@ describe('Agent Controllers - Mass Assignment Protection', () => {
|
|||
'author',
|
||||
'avatar',
|
||||
'category',
|
||||
'conversation_starters',
|
||||
'description',
|
||||
'id',
|
||||
'is_promoted',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue