Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] tracing doesn't work when port is manually entered (ex: port=6007) #2083

Closed
kangeugine opened this issue Jan 12, 2024 · 2 comments · Fixed by #2514
Closed

[BUG] tracing doesn't work when port is manually entered (ex: port=6007) #2083

kangeugine opened this issue Jan 12, 2024 · 2 comments · Fixed by #2514
Assignees
Labels
bug Something isn't working c/traces

Comments

@kangeugine
Copy link

Describe the bug
Tracing doesn't work when port is manually entered through px.launch_app
The code below works fine when port is not manually entered (default=6006)

To Reproduce
Steps to reproduce the behavior:

import phoenix as px

from dotenv import load_dotenv, find_dotenv

from langchain.chat_models import ChatOpenAI
from langchain.prompts import ChatPromptTemplate
from langchain.chains import LLMChain
from phoenix.trace.langchain import OpenInferenceTracer, LangChainInstrumentor

load_dotenv(find_dotenv())
session = px.launch_app(port=6007) # HIGHLIGHT
tracer = OpenInferenceTracer()
LangChainInstrumentor(tracer).instrument()

llm = ChatOpenAI(temperature=0.9, model="gpt-3.5-turbo")
prompt = ChatPromptTemplate.from_template(
    "What is the best name to describe \
    a company that makes {product}?"
)
chain = LLMChain(llm=llm, prompt=prompt)
product = "Queen Size Sheet Set"
chain.run(product)

session.url

after running the above code, go to the url provided by session.url

Expected behavior
I would expect trace to exist for the query, prompt, and output

Screenshots
If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

  • OS: Apple M1 (macOS Ventura 13.5.1)
  • Browser: Chrome
  • pheonix version: 2.4.1
  • langchain version: 0.1.0
@kangeugine kangeugine added bug Something isn't working triage issues that need triage labels Jan 12, 2024
@RogerHYang
Copy link
Contributor

@kangeugine Can you try setting it via environment variable instead?

import os

os.environ["PHOENIX_PORT"] = "6007"

@mikeldking mikeldking added documentation Improvements or additions to documentation c/traces and removed triage issues that need triage labels Jan 12, 2024
@mikeldking
Copy link
Contributor

soft deprecate params in launch_app and encourage everyone to use environment variables.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working c/traces
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants