Really enjoying getting to know Phoenix so far. Great platform! Now I am moving on to evals and following the quick start - https://docs.arize.com/phoenix/evaluation/evals During the first part of it there is the following code to launch Phoenix. import phoenix as px session = px.launch_app(trace=trace_ds) session.view() Since I am already running Phoenix on another server in a Docker container, how can I get access to a session from that instance? Is there a connect method or something? I tried the following with Client, but was unsuccessful. spans_df = px.Client(endpoint="http://192.168.1.69:6006").get_spans_dataframe() spans_df[["name", "span_kind", "attributes.input.value", "attributes.retrieval.documents"]].head()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[10], line 2
1 spans_df = px.Client(endpoint="http://192.168.1.69:6006").get_spans_dataframe()
----> 2 spans_df[["name", "span_kind", "attributes.input.value", "attributes.retrieval.documents"]].head()
TypeError: 'NoneType' object is not subscriptable
Same goes with the example notebook - https://colab.research.google.com/github/Arize-ai/phoenix/blob/main/tutorials/llm_ops_overview.ipynb How can I connect to an existing running Phoenix server in Docker versus launching a new one in code?
When running in a notebook attached to a remote instance there’s no need to launch or view in the notebook so you can skip those steps!
You have the right idea with the client. But you may need to specify the project in the parameters
Mikyo That's where I am a little confused. How do I attach or let my code in a notebook know about the remote Phoenix instance? If the answer is with the client, I am still having some trouble connecting to it. Currently, all the traces are in the 'default' project but I am still having problems retrieving them as a dataframe from the remote Phoenix instance. endpoint = "http://192.168.1.69:6006" spans_df = px.Client(endpoint=endpoint).get_spans_dataframe() spans_df[["name", "span_kind", "attributes.input.value", "attributes.retrieval.documents"]].head()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[15], line 4
1 endpoint = "http://192.168.1.69:6006"
3 spans_df = px.Client(endpoint=endpoint).get_spans_dataframe()
----> 4 spans_df[["name", "span_kind", "attributes.input.value", "attributes.retrieval.documents"]].head()
TypeError: 'NoneType' object is not subscriptable
You mentioned earlier, I might need to specify the project in the parameters earlier. How do I do this? endpoint = "http://192.168.1.69:6006" project = "default" spans_df = px.Client(project=project, endpoint=endpoint).get_spans_dataframe() spans_df[["name", "span_kind", "attributes.input.value", "attributes.retrieval.documents"]].head()
---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
Cell In[16], line 4
1 endpoint = "http://192.168.1.69:6006"
2 project = "default"
----> 4 spans_df = px.Client(project=project, endpoint=endpoint).get_spans_dataframe()
5 spans_df[["name", "span_kind", "attributes.input.value", "attributes.retrieval.documents"]].head()
TypeError: Client.__init__() got an unexpected keyword argument 'project'
Thanks again for your help 🙏
Hey Jonathan H. project_name is a parameter to get_spans_dataframe https://docs.arize.com/phoenix/api/client#methods
That worked like a charm, thank-you sir!
