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

Issue: Cannot see scores in LangSmith dashboard #1163

Open
jasonkang14 opened this issue Nov 3, 2024 · 2 comments
Open

Issue: Cannot see scores in LangSmith dashboard #1163

jasonkang14 opened this issue Nov 3, 2024 · 2 comments

Comments

@jasonkang14
Copy link

Issue you'd like to raise.

I cannot see the scores of my evaluations in LangSmith experiments dashboard
Screenshot 2024-11-03 at 4 43 47 PM

Below is the code,

# Grade prompt
from langsmith import EvaluationResult
grade_prompt_answer_helpfulness = prompt = hub.pull("langchain-ai/rag-answer-helpfulness")

def answer_helpfulness_evaluator(run, example) -> dict:
    """
    A simple evaluator for RAG answer helpfulness
    """

    # Get question, ground truth answer, RAG chain answer
    input_question = example.inputs.get("input_question") or ""
    prediction = run.outputs.get("output") or ""

    # LLM grader
    llm = ChatOpenAI(model="gpt-4o", temperature=0)

    # Structured prompt
    answer_grader = grade_prompt_answer_helpfulness | llm

    # Run evaluator
    score = answer_grader.invoke({"question": input_question,
                                  "student_answer": prediction})
    score = score["Score"]
    print(f'score in answer_helpfulness_evaluator: {score}')
    return EvaluationResult(key="answer_helpfulness_score", score=score)

from uuid import uuid4
from langsmith.evaluation import evaluate
from llm import get_ai_response

experiment_results = evaluate(
    lambda inputs: get_ai_response(inputs["input_question"]),
    data=dataset_name, 
    max_concurrency=2, 
    evaluators=[answer_evaluator, answer_helpfulness_evaluator], 
    experiment_prefix="test-run",
    metadata={"version": str(uuid4()), "chunk_count": "2"}, 
)

Suggestion:

Am I missing a configuration?

@hinthornw
Copy link
Collaborator

Hm thislooks correct at first glance - are there any error logs in your terminal?

@jasonkang14
Copy link
Author

i dont see any error logs in the terminal.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants