Skip to content

Scripts to create a Dbizi dataset and evaluate an assistant#227

Merged
juananpe merged 4 commits intoLamb-Project:langsmithfrom
mBerasategui-ehu:langsmith
Jan 29, 2026
Merged

Scripts to create a Dbizi dataset and evaluate an assistant#227
juananpe merged 4 commits intoLamb-Project:langsmithfrom
mBerasategui-ehu:langsmith

Conversation

@mBerasategui-ehu
Copy link
Contributor

Added 2 scripts in scripts/langsmith:
-dbizi_dataset.py (creates a dataset in LangSmith with 15 questions about dbizi)
-evaluate_assistant.py (an llm-as-a-judge evaluates a given lamb assistant with the given dataset in LangSmith)

To try them, first configure these LangSmith env variables in backend/.env:
-LANGCHAIN_TRACING_V2=true
-LANGCHAIN_API_KEY=YOUR_LANGCHAIN_API_KEY
-LANGCHAIN_PROJECT=lamb-assistants
-LANGCHAIN_ENDPOINT=https://api.smith.langchain.com

And these 2 variables in evaluate_assistant.py:
-JWT_TOKEN = "your_jwt_token_here"
-ASSISTANT_ID = 1 (this should be the id of the dbizi assistant in lamb)

Then, run the scripts:
-first, dbizi_dataset.py
-then, evaluate_assistant.py

@mBerasategui-ehu
Copy link
Contributor Author

Fixed issues in evaluate_assistant.py and added dbizi_dataset_eus.py (same as dizi_dataset.py but in basque).

@mBerasategui-ehu
Copy link
Contributor Author

Now these variables are loaded from lamb-kb-server-stable/backend/.env instead of having them hardcoded:
API_BASE_URL = os.getenv("API_BASE_URL")
JWT_TOKEN = os.getenv("JWT_TOKEN")
ASSISTANT_ID = int(os.getenv("ASSISTANT_ID"))
DATASET_NAME = os.getenv("DATASET_NAME")

@mBerasategui-ehu
Copy link
Contributor Author

Now EVALUATOR_MODEL is chosen via env var.

load_dotenv(project_root / "backend" / ".env")

# Configuration
API_BASE_URL = "http://localhost:9099"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please, use env variables here to avoid hardcoding them

try:
# Call the LLM judge (gpt-4.1)
response = openai_client.chat.completions.create(
model="gpt-4.1",
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be possible to define the model via env vars

@juananpe juananpe merged commit 95588db into Lamb-Project:langsmith Jan 29, 2026
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

Successfully merging this pull request may close these issues.

2 participants