Bugs and Improvements for Authenticated Phoenix Instance Reporting
I have a couple of bugs/improvements to report:
- 1.
Log Evaluation results to Authenticated Phoenix instance - The documentation at https://docs.arize.com/phoenix/tracing/how-to-tracing/feedback-and-annotations/llm-evaluations#connect-to-phoenix suggests adding os.environ["PHOENIX_CLIENT_HEADERS"] = f"api_key=...", but this does not work because of the following code at http://github.com/Arize-ai/phoenix/blob/main/src/phoenix/config.py#L717 . The function parse_env_headers parses header to be a dict like so {"api_key": ...} , which does not work as authorization header. Following this code, I used os.environ["PHOENIX_API_KEY"]=...which worked. Suggest changing the documentation to reflect adding PHOENIX_API_KEY instead of PHOENIX_CLIENT_HEADERS
def get_env_client_headers() -> dict[str, str]:
headers = parse_env_headers(getenv(ENV_PHOENIX_CLIENT_HEADERS))
if (api_key := get_env_phoenix_api_key()) and "authorization" not in [
k.lower() for k in headers
]:
headers["Authorization"] = f"Bearer {api_key}"
return headers2. Add a timeout param to the utility function get_qa_with_reference https://docs.arize.com/phoenix/tracing/how-to-tracing/importing-and-exporting-traces/extract-data-from-spans#q-and-a-on-retrieved-data - The 5 seconds default timeout is not enough to query on large tables, so recommend adding the timeout param which can then be passed to query_spans
