mirror of
https://github.com/rowboatlabs/rowboat.git
synced 2026-05-01 03:16:29 +02:00
Add output_visbility as agent field
This commit is contained in:
parent
080c9c6e55
commit
98dfe2e469
2 changed files with 14 additions and 8 deletions
|
|
@ -61,11 +61,9 @@ def add_openai_recommended_instructions_to_agents(agents):
|
|||
agent.instructions = RECOMMENDED_PROMPT_PREFIX + '\n\n' + agent.instructions
|
||||
return agents
|
||||
|
||||
def check_internal_visibility(current_agent, agent_configs):
|
||||
def check_internal_visibility(current_agent):
|
||||
"""Check if an agent is internal based on its outputVisibility"""
|
||||
agent_config = get_agent_config_by_name(current_agent.name, agent_configs)
|
||||
visibility = agent_config.get('outputVisibility', outputVisibility.EXTERNAL.value)
|
||||
return visibility == outputVisibility.INTERNAL.value
|
||||
return current_agent.output_visibility == outputVisibility.INTERNAL.value
|
||||
|
||||
def add_sender_details_to_messages(messages):
|
||||
for msg in messages:
|
||||
|
|
@ -175,7 +173,7 @@ async def run_turn_streamed(
|
|||
iter = 0
|
||||
while True:
|
||||
iter += 1
|
||||
is_internal_agent = check_internal_visibility(current_agent, agent_configs)
|
||||
is_internal_agent = check_internal_visibility(current_agent)
|
||||
print('-'*100)
|
||||
print(f"Iteration {iter} of turn loop")
|
||||
print(f"Current agent: {current_agent.name} (internal: {is_internal_agent})")
|
||||
|
|
@ -274,7 +272,7 @@ async def run_turn_streamed(
|
|||
yield ('message', message)
|
||||
|
||||
# Update tracking and switch to child
|
||||
if check_internal_visibility(event.new_agent, agent_configs):
|
||||
if check_internal_visibility(event.new_agent):
|
||||
child_call_counts[parent_child_key] = current_count + 1
|
||||
parent_stack.append(current_agent)
|
||||
current_agent = event.new_agent
|
||||
|
|
@ -381,7 +379,7 @@ async def run_turn_streamed(
|
|||
url_citations.append(citation)
|
||||
|
||||
# Determine message type and create message
|
||||
is_internal = check_internal_visibility(current_agent, agent_configs)
|
||||
is_internal = check_internal_visibility(current_agent)
|
||||
response_type = ResponseType.INTERNAL.value if is_internal else ResponseType.EXTERNAL.value
|
||||
|
||||
message = {
|
||||
|
|
|
|||
|
|
@ -13,7 +13,7 @@ from .helpers.access import (
|
|||
from .helpers.instructions import (
|
||||
add_rag_instructions_to_agent
|
||||
)
|
||||
|
||||
from .types import outputVisibility
|
||||
from agents import Agent as NewAgent, Runner, FunctionTool, RunContextWrapper, ModelSettings, WebSearchTool
|
||||
from .tracing import AgentTurnTraceProcessor
|
||||
# Add import for OpenAI functionality
|
||||
|
|
@ -265,6 +265,14 @@ def get_agents(agent_configs, tool_configs, complete_request):
|
|||
print(f"WARNING: Max calls per parent agent not received for agent {new_agent.name}. Using rowboat_agents default of {DEFAULT_MAX_CALLS_PER_PARENT_AGENT}")
|
||||
else:
|
||||
print(f"Max calls per parent agent for agent {new_agent.name}: {new_agent.max_calls_per_parent_agent}")
|
||||
|
||||
# Set output visibility
|
||||
new_agent.output_visibility = agent_config.get("outputVisibility", outputVisibility.EXTERNAL.value)
|
||||
if not agent_config.get("outputVisibility", None):
|
||||
print(f"WARNING: Output visibility not received for agent {new_agent.name}. Using rowboat_agents default of {new_agent.output_visibility}")
|
||||
else:
|
||||
print(f"Output visibility for agent {new_agent.name}: {new_agent.output_visibility}")
|
||||
|
||||
# Handle the connected agents
|
||||
new_agent_to_children[agent_config["name"]] = agent_config.get("connectedAgents", [])
|
||||
new_agent_name_to_index[agent_config["name"]] = len(new_agents)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue