INNER CODE UNIT · TypeScript

extractSwarmIdFromAgentName

ZaxbyHub/opencode-swarm · src/agents/index.ts:154

export function extractSwarmIdFromAgentName(
	agentName: string,
): string | undefined {
	if (!agentName) return undefined;
	const match = agentName.match(/^([^_]+)_/);
	return match ? match[1] : undefined;
}

/**
 * Get the model for an agent within a specific swarm config
 */
function getModelForAgent(
	agentName: string,
	swarmAgents?: Record<
		string,
		{
			model?: string;
			temperature?: number;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…