Merge remote-tracking branch 'origin/main' into musa/cli

This commit is contained in:
Musa 2026-02-17 07:28:07 -08:00
commit 0416573c82
293 changed files with 8728 additions and 9045 deletions

View file

@ -1,3 +1,3 @@
"""Plano CLI - Intelligent Prompt Gateway."""
__version__ = "0.4.6"
__version__ = "0.4.7"

View file

@ -53,34 +53,34 @@ def validate_and_render_schema():
ENVOY_CONFIG_TEMPLATE_FILE = os.getenv(
"ENVOY_CONFIG_TEMPLATE_FILE", "envoy.template.yaml"
)
ARCH_CONFIG_FILE = os.getenv("ARCH_CONFIG_FILE", "/app/arch_config.yaml")
ARCH_CONFIG_FILE_RENDERED = os.getenv(
"ARCH_CONFIG_FILE_RENDERED", "/app/arch_config_rendered.yaml"
PLANO_CONFIG_FILE = os.getenv("PLANO_CONFIG_FILE", "/app/plano_config.yaml")
PLANO_CONFIG_FILE_RENDERED = os.getenv(
"PLANO_CONFIG_FILE_RENDERED", "/app/plano_config_rendered.yaml"
)
ENVOY_CONFIG_FILE_RENDERED = os.getenv(
"ENVOY_CONFIG_FILE_RENDERED", "/etc/envoy/envoy.yaml"
)
ARCH_CONFIG_SCHEMA_FILE = os.getenv(
"ARCH_CONFIG_SCHEMA_FILE", "arch_config_schema.yaml"
PLANO_CONFIG_SCHEMA_FILE = os.getenv(
"PLANO_CONFIG_SCHEMA_FILE", "plano_config_schema.yaml"
)
env = Environment(loader=FileSystemLoader(os.getenv("TEMPLATE_ROOT", "./")))
template = env.get_template(ENVOY_CONFIG_TEMPLATE_FILE)
try:
validate_prompt_config(ARCH_CONFIG_FILE, ARCH_CONFIG_SCHEMA_FILE)
validate_prompt_config(PLANO_CONFIG_FILE, PLANO_CONFIG_SCHEMA_FILE)
except Exception as e:
print(str(e))
exit(1) # validate_prompt_config failed. Exit
with open(ARCH_CONFIG_FILE, "r") as file:
arch_config = file.read()
with open(PLANO_CONFIG_FILE, "r") as file:
plano_config = file.read()
with open(ARCH_CONFIG_SCHEMA_FILE, "r") as file:
arch_config_schema = file.read()
with open(PLANO_CONFIG_SCHEMA_FILE, "r") as file:
plano_config_schema = file.read()
config_yaml = yaml.safe_load(arch_config)
_ = yaml.safe_load(arch_config_schema)
config_yaml = yaml.safe_load(plano_config)
_ = yaml.safe_load(plano_config_schema)
inferred_clusters = {}
# Convert legacy llm_providers to model_providers
@ -145,7 +145,7 @@ def validate_and_render_schema():
inferred_clusters[name]["port"],
) = get_endpoint_and_port(endpoint, protocol)
print("defined clusters from arch_config.yaml: ", json.dumps(inferred_clusters))
print("defined clusters from plano_config.yaml: ", json.dumps(inferred_clusters))
if "prompt_targets" in config_yaml:
for prompt_target in config_yaml["prompt_targets"]:
@ -154,13 +154,13 @@ def validate_and_render_schema():
continue
if name not in inferred_clusters:
raise Exception(
f"Unknown endpoint {name}, please add it in endpoints section in your arch_config.yaml file"
f"Unknown endpoint {name}, please add it in endpoints section in your plano_config.yaml file"
)
arch_tracing = config_yaml.get("tracing", {})
plano_tracing = config_yaml.get("tracing", {})
# Resolution order: config yaml > OTEL_TRACING_GRPC_ENDPOINT env var > hardcoded default
opentracing_grpc_endpoint = arch_tracing.get(
opentracing_grpc_endpoint = plano_tracing.get(
"opentracing_grpc_endpoint",
os.environ.get(
"OTEL_TRACING_GRPC_ENDPOINT", DEFAULT_OTEL_TRACING_GRPC_ENDPOINT
@ -172,7 +172,7 @@ def validate_and_render_schema():
print(
f"Resolved opentracing_grpc_endpoint to {opentracing_grpc_endpoint} after expanding environment variables"
)
arch_tracing["opentracing_grpc_endpoint"] = opentracing_grpc_endpoint
plano_tracing["opentracing_grpc_endpoint"] = opentracing_grpc_endpoint
# ensure that opentracing_grpc_endpoint is a valid URL if present and start with http and must not have any path
if opentracing_grpc_endpoint:
urlparse_result = urlparse(opentracing_grpc_endpoint)
@ -436,8 +436,8 @@ def validate_and_render_schema():
f"Model alias 2 - '{alias_name}' targets '{target}' which is not defined as a model. Available models: {', '.join(sorted(model_name_keys))}"
)
arch_config_string = yaml.dump(config_yaml)
arch_llm_config_string = yaml.dump(config_yaml)
plano_config_string = yaml.dump(config_yaml)
plano_llm_config_string = yaml.dump(config_yaml)
use_agent_orchestrator = config_yaml.get("overrides", {}).get(
"use_agent_orchestrator", False
@ -449,11 +449,11 @@ def validate_and_render_schema():
if len(endpoints) == 0:
raise Exception(
"Please provide agent orchestrator in the endpoints section in your arch_config.yaml file"
"Please provide agent orchestrator in the endpoints section in your plano_config.yaml file"
)
elif len(endpoints) > 1:
raise Exception(
"Please provide single agent orchestrator in the endpoints section in your arch_config.yaml file"
"Please provide single agent orchestrator in the endpoints section in your plano_config.yaml file"
)
else:
agent_orchestrator = list(endpoints.keys())[0]
@ -463,11 +463,11 @@ def validate_and_render_schema():
data = {
"prompt_gateway_listener": prompt_gateway,
"llm_gateway_listener": llm_gateway,
"arch_config": arch_config_string,
"arch_llm_config": arch_llm_config_string,
"arch_clusters": inferred_clusters,
"arch_model_providers": updated_model_providers,
"arch_tracing": arch_tracing,
"plano_config": plano_config_string,
"plano_llm_config": plano_llm_config_string,
"plano_clusters": inferred_clusters,
"plano_model_providers": updated_model_providers,
"plano_tracing": plano_tracing,
"local_llms": llms_with_endpoint,
"agent_orchestrator": agent_orchestrator,
"listeners": listeners,
@ -479,25 +479,25 @@ def validate_and_render_schema():
with open(ENVOY_CONFIG_FILE_RENDERED, "w") as file:
file.write(rendered)
with open(ARCH_CONFIG_FILE_RENDERED, "w") as file:
file.write(arch_config_string)
with open(PLANO_CONFIG_FILE_RENDERED, "w") as file:
file.write(plano_config_string)
def validate_prompt_config(arch_config_file, arch_config_schema_file):
with open(arch_config_file, "r") as file:
arch_config = file.read()
def validate_prompt_config(plano_config_file, plano_config_schema_file):
with open(plano_config_file, "r") as file:
plano_config = file.read()
with open(arch_config_schema_file, "r") as file:
arch_config_schema = file.read()
with open(plano_config_schema_file, "r") as file:
plano_config_schema = file.read()
config_yaml = yaml.safe_load(arch_config)
config_schema_yaml = yaml.safe_load(arch_config_schema)
config_yaml = yaml.safe_load(plano_config)
config_schema_yaml = yaml.safe_load(plano_config_schema)
try:
validate(config_yaml, config_schema_yaml)
except Exception as e:
print(
f"Error validating arch_config file: {arch_config_file}, schema file: {arch_config_schema_file}, error: {e}"
f"Error validating plano_config file: {plano_config_file}, schema file: {plano_config_schema_file}, error: {e}"
)
raise e

View file

@ -5,5 +5,5 @@ PLANO_COLOR = "#969FF4"
SERVICE_NAME_ARCHGW = "plano"
PLANO_DOCKER_NAME = "plano"
PLANO_DOCKER_IMAGE = os.getenv("PLANO_DOCKER_IMAGE", "katanemo/plano:0.4.6")
PLANO_DOCKER_IMAGE = os.getenv("PLANO_DOCKER_IMAGE", "katanemo/plano:0.4.7")
DEFAULT_OTEL_TRACING_GRPC_ENDPOINT = "http://host.docker.internal:4317"

View file

@ -24,17 +24,17 @@ from planoai.docker_cli import (
log = getLogger(__name__)
def _get_gateway_ports(arch_config_file: str) -> list[int]:
def _get_gateway_ports(plano_config_file: str) -> list[int]:
PROMPT_GATEWAY_DEFAULT_PORT = 10000
LLM_GATEWAY_DEFAULT_PORT = 12000
# parse arch_config_file yaml file and get prompt_gateway_port
arch_config_dict = {}
with open(arch_config_file) as f:
arch_config_dict = yaml.safe_load(f)
# parse plano_config_file yaml file and get prompt_gateway_port
plano_config_dict = {}
with open(plano_config_file) as f:
plano_config_dict = yaml.safe_load(f)
listeners, _, _ = convert_legacy_listeners(
arch_config_dict.get("listeners"), arch_config_dict.get("llm_providers")
plano_config_dict.get("listeners"), plano_config_dict.get("llm_providers")
)
all_ports = [listener.get("port") for listener in listeners]
@ -45,7 +45,7 @@ def _get_gateway_ports(arch_config_file: str) -> list[int]:
return all_ports
def start_arch(arch_config_file, env, log_timeout=120, foreground=False):
def start_plano(plano_config_file, env, log_timeout=120, foreground=False):
"""
Start Docker Compose in detached mode and stream logs until services are healthy.
@ -54,7 +54,7 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False):
log_timeout (int): Time in seconds to show logs before checking for healthy state.
"""
log.info(
f"Starting arch gateway, image name: {PLANO_DOCKER_NAME}, tag: {PLANO_DOCKER_IMAGE}"
f"Starting plano gateway, image name: {PLANO_DOCKER_NAME}, tag: {PLANO_DOCKER_IMAGE}"
)
try:
@ -64,10 +64,10 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False):
docker_stop_container(PLANO_DOCKER_NAME)
docker_remove_container(PLANO_DOCKER_NAME)
gateway_ports = _get_gateway_ports(arch_config_file)
gateway_ports = _get_gateway_ports(plano_config_file)
return_code, _, plano_stderr = docker_start_plano_detached(
arch_config_file,
plano_config_file,
env,
gateway_ports,
)
@ -117,7 +117,7 @@ def start_arch(arch_config_file, env, log_timeout=120, foreground=False):
stream_gateway_logs(follow=True)
except KeyboardInterrupt:
log.info("Keyboard interrupt received, stopping arch gateway service.")
log.info("Keyboard interrupt received, stopping plano gateway service.")
stop_docker_container()
@ -144,15 +144,15 @@ def stop_docker_container(service=PLANO_DOCKER_NAME):
log.info(f"Failed to shut down services: {str(e)}")
def start_cli_agent(arch_config_file=None, settings_json="{}"):
def start_cli_agent(plano_config_file=None, settings_json="{}"):
"""Start a CLI client connected to Plano."""
with open(arch_config_file, "r") as file:
arch_config = file.read()
arch_config_yaml = yaml.safe_load(arch_config)
with open(plano_config_file, "r") as file:
plano_config = file.read()
plano_config_yaml = yaml.safe_load(plano_config)
# Get egress listener configuration
egress_config = arch_config_yaml.get("listeners", {}).get("egress_traffic", {})
egress_config = plano_config_yaml.get("listeners", {}).get("egress_traffic", {})
host = egress_config.get("host", "127.0.0.1")
port = egress_config.get("port", 12000)
@ -167,7 +167,7 @@ def start_cli_agent(arch_config_file=None, settings_json="{}"):
env = os.environ.copy()
env.update(
{
"ANTHROPIC_AUTH_TOKEN": "test", # Use test token for arch
"ANTHROPIC_AUTH_TOKEN": "test", # Use test token for plano
"ANTHROPIC_API_KEY": "",
"ANTHROPIC_BASE_URL": f"http://{host}:{port}",
"NO_PROXY": host,
@ -184,7 +184,7 @@ def start_cli_agent(arch_config_file=None, settings_json="{}"):
]
else:
# Check if arch.claude.code.small.fast alias exists in model_aliases
model_aliases = arch_config_yaml.get("model_aliases", {})
model_aliases = plano_config_yaml.get("model_aliases", {})
if "arch.claude.code.small.fast" in model_aliases:
env["ANTHROPIC_SMALL_FAST_MODEL"] = "arch.claude.code.small.fast"
else:
@ -220,7 +220,7 @@ def start_cli_agent(arch_config_file=None, settings_json="{}"):
# Use claude from PATH
claude_path = "claude"
log.info(f"Connecting Claude Code Agent to Arch at {host}:{port}")
log.info(f"Connecting Claude Code Agent to Plano at {host}:{port}")
try:
subprocess.run([claude_path] + claude_args, env=env, check=True)

View file

@ -41,7 +41,7 @@ def docker_remove_container(container: str) -> str:
def docker_start_plano_detached(
arch_config_file: str,
plano_config_file: str,
env: dict,
gateway_ports: list[int],
) -> str:
@ -58,7 +58,7 @@ def docker_start_plano_detached(
port_mappings_args = [item for port in port_mappings for item in ("-p", port)]
volume_mappings = [
f"{arch_config_file}:/app/arch_config.yaml:ro",
f"{plano_config_file}:/app/plano_config.yaml:ro",
]
volume_mappings_args = [
item for volume in volume_mappings for item in ("-v", volume)
@ -115,7 +115,7 @@ def stream_gateway_logs(follow, service="plano"):
log.info(f"Failed to stream logs: {str(e)}")
def docker_validate_plano_schema(arch_config_file):
def docker_validate_plano_schema(plano_config_file):
import os
env = os.environ.copy()
@ -129,7 +129,7 @@ def docker_validate_plano_schema(arch_config_file):
"--rm",
*env_args,
"-v",
f"{arch_config_file}:/app/arch_config.yaml:ro",
f"{plano_config_file}:/app/plano_config.yaml:ro",
"--entrypoint",
"python",
PLANO_DOCKER_IMAGE,

View file

@ -22,7 +22,7 @@ from planoai.utils import (
find_repo_root,
)
from planoai.core import (
start_arch,
start_plano,
stop_docker_container,
start_cli_agent,
)
@ -45,7 +45,7 @@ def _is_port_in_use(port: int) -> bool:
with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:
try:
s.bind(("0.0.0.0", port))
s.bind(("0.0.0.0", port)) # noqa: S104
return False
except OSError:
return True
@ -200,12 +200,12 @@ def up(file, path, foreground, with_tracing, tracing_port):
_print_cli_header(console)
# Use the utility function to find config file
arch_config_file = find_config_file(path, file)
plano_config_file = find_config_file(path, file)
# Check if the file exists
if not os.path.exists(arch_config_file):
if not os.path.exists(plano_config_file):
console.print(
f"[red]✗[/red] Config file not found: [dim]{arch_config_file}[/dim]"
f"[red]✗[/red] Config file not found: [dim]{plano_config_file}[/dim]"
)
sys.exit(1)
@ -216,7 +216,7 @@ def up(file, path, foreground, with_tracing, tracing_port):
validation_return_code,
_,
validation_stderr,
) = docker_validate_plano_schema(arch_config_file)
) = docker_validate_plano_schema(plano_config_file)
if validation_return_code != 0:
console.print(f"[red]✗[/red] Validation failed")
@ -234,7 +234,7 @@ def up(file, path, foreground, with_tracing, tracing_port):
env.pop("PATH", None)
# Check access keys
access_keys = get_llm_provider_access_keys(arch_config_file=arch_config_file)
access_keys = get_llm_provider_access_keys(plano_config_file=plano_config_file)
access_keys = set(access_keys)
access_keys = [item[1:] if item.startswith("$") else item for item in access_keys]
@ -302,7 +302,7 @@ def up(file, path, foreground, with_tracing, tracing_port):
env.update(env_stage)
try:
start_arch(arch_config_file, env, foreground=foreground)
start_plano(plano_config_file, env, foreground=foreground)
# When tracing is enabled but --foreground is not, keep the process
# alive so the OTLP collector continues to receive spans.
@ -363,35 +363,35 @@ def generate_prompt_targets(file):
def logs(debug, follow):
"""Stream logs from access logs services."""
archgw_process = None
plano_process = None
try:
if debug:
archgw_process = multiprocessing.Process(
plano_process = multiprocessing.Process(
target=stream_gateway_logs, args=(follow,)
)
archgw_process.start()
plano_process.start()
archgw_access_logs_process = multiprocessing.Process(
plano_access_logs_process = multiprocessing.Process(
target=stream_access_logs, args=(follow,)
)
archgw_access_logs_process.start()
archgw_access_logs_process.join()
plano_access_logs_process.start()
plano_access_logs_process.join()
if archgw_process:
archgw_process.join()
if plano_process:
plano_process.join()
except KeyboardInterrupt:
log.info("KeyboardInterrupt detected. Exiting.")
if archgw_access_logs_process.is_alive():
archgw_access_logs_process.terminate()
if archgw_process and archgw_process.is_alive():
archgw_process.terminate()
if plano_access_logs_process.is_alive():
plano_access_logs_process.terminate()
if plano_process and plano_process.is_alive():
plano_process.terminate()
@click.command()
@click.argument("type", type=click.Choice(["claude"]), required=True)
@click.argument("file", required=False) # Optional file argument
@click.option(
"--path", default=".", help="Path to the directory containing arch_config.yaml"
"--path", default=".", help="Path to the directory containing plano_config.yaml"
)
@click.option(
"--settings",
@ -405,20 +405,20 @@ def cli_agent(type, file, path, settings):
"""
# Check if plano docker container is running
archgw_status = docker_container_status(PLANO_DOCKER_NAME)
if archgw_status != "running":
log.error(f"plano docker container is not running (status: {archgw_status})")
plano_status = docker_container_status(PLANO_DOCKER_NAME)
if plano_status != "running":
log.error(f"plano docker container is not running (status: {plano_status})")
log.error("Please start plano using the 'planoai up' command.")
sys.exit(1)
# Determine arch_config.yaml path
arch_config_file = find_config_file(path, file)
if not os.path.exists(arch_config_file):
log.error(f"Config file not found: {arch_config_file}")
# Determine plano_config.yaml path
plano_config_file = find_config_file(path, file)
if not os.path.exists(plano_config_file):
log.error(f"Config file not found: {plano_config_file}")
sys.exit(1)
try:
start_cli_agent(arch_config_file, settings)
start_cli_agent(plano_config_file, settings)
except SystemExit:
# Re-raise SystemExit to preserve exit codes
raise

View file

@ -1,13 +1,6 @@
version: v0.1
version: v0.3.0
listeners:
egress_traffic:
address: 0.0.0.0
port: 12000
message_format: openai
timeout: 30s
llm_providers:
model_providers:
# OpenAI Models
- model: openai/gpt-5-2025-08-07
access_key: $OPENAI_API_KEY
@ -39,5 +32,10 @@ model_aliases:
arch.claude.code.small.fast:
target: claude-haiku-4-5
listeners:
- type: model
name: model_listener
port: 12000
tracing:
random_sampling: 100

View file

@ -1,25 +1,36 @@
version: v0.1
version: v0.3.0
listeners:
egress_traffic:
address: 0.0.0.0
port: 12000
message_format: openai
timeout: 30s
llm_providers:
agents:
- id: assistant
url: http://localhost:10510
model_providers:
# OpenAI Models
- model: openai/gpt-5-mini-2025-08-07
access_key: $OPENAI_API_KEY
default: true
# Anthropic Models
# Anthropic Models
- model: anthropic/claude-sonnet-4-20250514
access_key: $ANTHROPIC_API_KEY
listeners:
- type: agent
name: conversation_service
port: 8001
router: plano_orchestrator_v1
agents:
- id: assistant
description: |
A conversational assistant that maintains context across multi-turn
conversations. It can answer follow-up questions, remember previous
context, and provide coherent responses in ongoing dialogues.
# State storage configuration for v1/responses API
# Manages conversation state for multi-turn conversations
state_storage:
# Type: memory | postgres
type: memory
tracing:
random_sampling: 100

View file

@ -1,13 +1,6 @@
version: v0.1.0
version: v0.3.0
listeners:
egress_traffic:
address: 0.0.0.0
port: 12000
message_format: openai
timeout: 30s
llm_providers:
model_providers:
- model: openai/gpt-4o-mini
access_key: $OPENAI_API_KEY
@ -25,5 +18,10 @@ llm_providers:
- name: code generation
description: generating new code snippets, functions, or boilerplate based on user prompts or requirements
listeners:
- type: model
name: model_listener
port: 12000
tracing:
random_sampling: 100

View file

@ -31,6 +31,17 @@ MAX_TRACES = 50
MAX_SPANS_PER_TRACE = 500
class TraceListenerBindError(RuntimeError):
"""Raised when the OTLP/gRPC listener cannot bind to the requested address."""
def _trace_listener_bind_error_message(address: str) -> str:
return (
f"Failed to start OTLP listener on {address}: address is already in use.\n"
"Stop the process using that port or run `planoai trace listen --port <PORT>`."
)
@dataclass
class TraceSummary:
trace_id: str
@ -496,7 +507,15 @@ def _start_trace_server(host: str, grpc_port: int) -> grpc.Server:
trace_service_pb2_grpc.add_TraceServiceServicer_to_server(
_OTLPTraceServicer(), grpc_server
)
grpc_server.add_insecure_port(f"{host}:{grpc_port}")
address = f"{host}:{grpc_port}"
try:
bound_port = grpc_server.add_insecure_port(address)
except RuntimeError as exc:
raise TraceListenerBindError(
_trace_listener_bind_error_message(address)
) from exc
if bound_port == 0:
raise TraceListenerBindError(_trace_listener_bind_error_message(address))
grpc_server.start()
return grpc_server

View file

@ -68,19 +68,19 @@ def find_repo_root(start_path=None):
return None
def has_ingress_listener(arch_config_file):
"""Check if the arch config file has ingress_traffic listener configured."""
def has_ingress_listener(plano_config_file):
"""Check if the plano config file has ingress_traffic listener configured."""
try:
with open(arch_config_file) as f:
arch_config_dict = yaml.safe_load(f)
with open(plano_config_file) as f:
plano_config_dict = yaml.safe_load(f)
ingress_traffic = arch_config_dict.get("listeners", {}).get(
ingress_traffic = plano_config_dict.get("listeners", {}).get(
"ingress_traffic", {}
)
return bool(ingress_traffic)
except Exception as e:
log.error(f"Error reading config file {arch_config_file}: {e}")
log.error(f"Error reading config file {plano_config_file}: {e}")
return False
@ -154,34 +154,37 @@ def convert_legacy_listeners(
)
listener["model_providers"] = model_providers or []
model_provider_set = True
llm_gateway_listener = listener
# Merge user listener values into defaults for the Envoy template
llm_gateway_listener = {**llm_gateway_listener, **listener}
elif listener.get("type") == "prompt":
prompt_gateway_listener = {**prompt_gateway_listener, **listener}
if not model_provider_set:
listeners.append(llm_gateway_listener)
return listeners, llm_gateway_listener, prompt_gateway_listener
def get_llm_provider_access_keys(arch_config_file):
with open(arch_config_file, "r") as file:
arch_config = file.read()
arch_config_yaml = yaml.safe_load(arch_config)
def get_llm_provider_access_keys(plano_config_file):
with open(plano_config_file, "r") as file:
plano_config = file.read()
plano_config_yaml = yaml.safe_load(plano_config)
access_key_list = []
# Convert legacy llm_providers to model_providers
if "llm_providers" in arch_config_yaml:
if "model_providers" in arch_config_yaml:
if "llm_providers" in plano_config_yaml:
if "model_providers" in plano_config_yaml:
raise Exception(
"Please provide either llm_providers or model_providers, not both. llm_providers is deprecated, please use model_providers instead"
)
arch_config_yaml["model_providers"] = arch_config_yaml["llm_providers"]
del arch_config_yaml["llm_providers"]
plano_config_yaml["model_providers"] = plano_config_yaml["llm_providers"]
del plano_config_yaml["llm_providers"]
listeners, _, _ = convert_legacy_listeners(
arch_config_yaml.get("listeners"), arch_config_yaml.get("model_providers")
plano_config_yaml.get("listeners"), plano_config_yaml.get("model_providers")
)
for prompt_target in arch_config_yaml.get("prompt_targets", []):
for prompt_target in plano_config_yaml.get("prompt_targets", []):
for k, v in prompt_target.get("endpoint", {}).get("http_headers", {}).items():
if k.lower() == "authorization":
print(
@ -200,7 +203,7 @@ def get_llm_provider_access_keys(arch_config_file):
access_key_list.append(access_key)
# Extract environment variables from state_storage.connection_string
state_storage = arch_config_yaml.get("state_storage_v1_responses")
state_storage = plano_config_yaml.get("state_storage_v1_responses")
if state_storage:
connection_string = state_storage.get("connection_string")
if connection_string and isinstance(connection_string, str):
@ -251,16 +254,16 @@ def find_config_file(path=".", file=None):
# If a file is provided, process that file
return os.path.abspath(file)
else:
# If no file is provided, use the path and look for arch_config.yaml first, then config.yaml for convenience
arch_config_file = os.path.abspath(os.path.join(path, "config.yaml"))
if not os.path.exists(arch_config_file):
arch_config_file = os.path.abspath(os.path.join(path, "arch_config.yaml"))
return arch_config_file
# If no file is provided, use the path and look for plano_config.yaml first, then config.yaml for convenience
plano_config_file = os.path.abspath(os.path.join(path, "config.yaml"))
if not os.path.exists(plano_config_file):
plano_config_file = os.path.abspath(os.path.join(path, "plano_config.yaml"))
return plano_config_file
def stream_access_logs(follow):
"""
Get the archgw access logs
Get the plano access logs
"""
follow_arg = "-f" if follow else ""