MCPcopy Create free account
hub / github.com/google/adk-samples / parse_key_value_pairs

Function parse_key_value_pairs

python/agents/RAG/rag/app_utils/deploy.py:61–71  ·  view source on GitHub ↗

Parse key-value pairs from a comma-separated KEY=VALUE string.

(kv_string: str | None)

Source from the content-addressed store, hash-verified

59
60
61def parse_key_value_pairs(kv_string: str | None) -> dict[str, str]:
62 """Parse key-value pairs from a comma-separated KEY=VALUE string."""
63 result = {}
64 if kv_string:
65 for pair in kv_string.split(","):
66 if "=" in pair:
67 key, value = pair.split("=", 1)
68 result[key.strip()] = value.strip()
69 else:
70 logging.warning(f"Skipping malformed key-value pair: {pair}")
71 return result
72
73
74def parse_secrets(secrets_string: str | None) -> dict[str, dict[str, str]]:

Callers 2

parse_secretsFunction · 0.70
deploy_agent_engine_appFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected