Skip to content

Commit

Permalink
fix: use environment variable for project name
Browse files Browse the repository at this point in the history
  • Loading branch information
RogerHYang committed Mar 14, 2024
1 parent fe409a4 commit edd678d
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/phoenix/session/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,7 @@ def _warn_if_phoenix_is_not_running(self) -> None:
)

def log_evaluations(self, *evals: Evaluations, project_name: Optional[str] = None) -> None:
project_name = project_name or get_env_project_name()
for evaluation in evals:
table = evaluation.to_pyarrow_table()
sink = pa.BufferOutputStream()
Expand Down
3 changes: 3 additions & 0 deletions src/phoenix/trace/dsl/helpers.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import pandas as pd
from openinference.semconv.trace import DocumentAttributes, SpanAttributes

from phoenix.config import get_env_project_name
from phoenix.trace.dsl import SpanQuery

DOCUMENT_CONTENT = DocumentAttributes.DOCUMENT_CONTENT
Expand All @@ -28,6 +29,7 @@ def query_spans(


def get_retrieved_documents(obj: CanQuerySpans, project_name: Optional[str] = None) -> pd.DataFrame:
project_name = project_name or get_env_project_name()
return cast(
pd.DataFrame,
obj.query_spans(
Expand All @@ -45,6 +47,7 @@ def get_retrieved_documents(obj: CanQuerySpans, project_name: Optional[str] = No


def get_qa_with_reference(obj: CanQuerySpans, project_name: Optional[str] = None) -> pd.DataFrame:
project_name = project_name or get_env_project_name()
return pd.concat(
cast(
List[pd.DataFrame],
Expand Down

0 comments on commit edd678d

Please sign in to comment.