mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-04-26 08:56:22 +02:00
fix: remove no-agent message that was incorrectly triggering for pipeline start agents (#245)
- Removed 'Hi! To get started with chatting with your Assistant please create an agent first!' message feature - Pipelines can now be set as start agents without triggering this error message - Removed checks from emitGreetingTurn() and streamResponse() functions - System now handles all agent types properly as start agents
This commit is contained in:
parent
458302fc43
commit
3c4e0473b9
1 changed files with 0 additions and 42 deletions
|
|
@ -379,20 +379,6 @@ function mapConfig(workflow: z.infer<typeof Workflow>): {
|
||||||
}
|
}
|
||||||
|
|
||||||
async function* emitGreetingTurn(logger: PrefixLogger, workflow: z.infer<typeof Workflow>): AsyncIterable<z.infer<typeof ZOutMessage>> {
|
async function* emitGreetingTurn(logger: PrefixLogger, workflow: z.infer<typeof Workflow>): AsyncIterable<z.infer<typeof ZOutMessage>> {
|
||||||
// Check if there are no agents or no start agent
|
|
||||||
if (workflow.agents.length === 0 || !workflow.startAgent) {
|
|
||||||
logger.log(`no agents available, emitting no-agent message`);
|
|
||||||
|
|
||||||
// emit no-agent message
|
|
||||||
yield* emitEvent(logger, {
|
|
||||||
role: 'assistant',
|
|
||||||
content: 'Hi! To get started with chatting with your Assistant please create an agent first!',
|
|
||||||
agentName: 'System',
|
|
||||||
responseType: 'external',
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
// find the greeting prompt
|
// find the greeting prompt
|
||||||
const prompt = workflow.prompts.find(p => p.type === 'greeting')?.prompt || 'How can I help you today?';
|
const prompt = workflow.prompts.find(p => p.type === 'greeting')?.prompt || 'How can I help you today?';
|
||||||
logger.log(`greeting turn: ${prompt}`);
|
logger.log(`greeting turn: ${prompt}`);
|
||||||
|
|
@ -1288,20 +1274,6 @@ export async function* streamResponse(
|
||||||
logger.log(`start agent: ${workflow.startAgent}`);
|
logger.log(`start agent: ${workflow.startAgent}`);
|
||||||
logger.log(`=== END CONFIGURATION ===`);
|
logger.log(`=== END CONFIGURATION ===`);
|
||||||
|
|
||||||
// Check if there are no agents or no start agent
|
|
||||||
if (Object.keys(agentConfig).length === 0 || !workflow.startAgent) {
|
|
||||||
logger.log(`no agents available, emitting no-agent message`);
|
|
||||||
|
|
||||||
// emit no-agent message
|
|
||||||
yield* emitEvent(logger, {
|
|
||||||
role: 'assistant',
|
|
||||||
content: 'Hi! To get started with chatting with your Assistant please create an agent first!',
|
|
||||||
agentName: 'System',
|
|
||||||
responseType: 'external',
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const stack: string[] = [];
|
const stack: string[] = [];
|
||||||
logger.log(`initialized stack: ${JSON.stringify(stack)}`);
|
logger.log(`initialized stack: ${JSON.stringify(stack)}`);
|
||||||
|
|
||||||
|
|
@ -1324,20 +1296,6 @@ export async function* streamResponse(
|
||||||
const startOfTurnAgentName = getStartOfTurnAgentName(logger, messages, agentConfig, pipelineConfig, workflow);
|
const startOfTurnAgentName = getStartOfTurnAgentName(logger, messages, agentConfig, pipelineConfig, workflow);
|
||||||
logger.log(`🎯 START AGENT DECISION: ${startOfTurnAgentName}`);
|
logger.log(`🎯 START AGENT DECISION: ${startOfTurnAgentName}`);
|
||||||
|
|
||||||
// Additional safety check - if startOfTurnAgentName is empty or invalid, return no-agent message
|
|
||||||
if (!startOfTurnAgentName || !agentConfig[startOfTurnAgentName]) {
|
|
||||||
logger.log(`invalid start agent name: ${startOfTurnAgentName}, emitting no-agent message`);
|
|
||||||
|
|
||||||
// emit no-agent message
|
|
||||||
yield* emitEvent(logger, {
|
|
||||||
role: 'assistant',
|
|
||||||
content: 'Hi! To get started with chatting with your Assistant please create an agent first!',
|
|
||||||
agentName: 'System',
|
|
||||||
responseType: 'external',
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
let agentName: string | null = startOfTurnAgentName;
|
let agentName: string | null = startOfTurnAgentName;
|
||||||
|
|
||||||
// start the turn loop
|
// start the turn loop
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue