• About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
Monday, August 24, 2026
mGrowTech
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions
No Result
View All Result
mGrowTech
No Result
View All Result
Home Al, Analytics and Automation

Build a Complete Langfuse Observability and Evaluation Pipeline for Tracing, Prompt Management, Scoring, and Experiments

Josh by Josh
May 25, 2026
in Al, Analytics and Automation
0
Build a Complete Langfuse Observability and Evaluation Pipeline for Tracing, Prompt Management, Scoring, and Experiments


print("\nPART 5 ── Datasets & experiments --------------------------------------")
DATASET = "capital-cities-tutorial"
langfuse.create_dataset(name=DATASET, description="Capital-city QA benchmark")
_items = [
   ("What is the capital of France?",  "Paris"),
   ("What is the capital of Germany?", "Berlin"),
   ("What is the capital of Japan?",   "Tokyo"),
   ("What is the capital of Italy?",   "Rome"),
]
for i, (q, a) in enumerate(_items):
   langfuse.create_dataset_item(dataset_name=DATASET, id=f"cap-{i}",
                                input={"question": q}, expected_output=a)
def capital_task(*, item, **kwargs):
   question = item.input["question"] if isinstance(item.input, dict) else item.input
   return llm_chat([{"role": "user", "content": question}], name="experiment-answer")
def accuracy(*, input, output, expected_output, metadata=None, **kwargs):
   hit = bool(expected_output) and expected_output.lower() in (output or "").lower()
   return Evaluation(name="accuracy", value=1.0 if hit else 0.0,
                     comment="exact-match contains check")
def conciseness(*, input, output, **kwargs):
   return Evaluation(name="char_length", value=float(len(output or "")))
def mean_accuracy(*, item_results, **kwargs):
   vals = [e.value for r in item_results for e in r.evaluations if e.name == "accuracy"]
   avg = sum(vals) / len(vals) if vals else 0.0
   return Evaluation(name="mean_accuracy", value=avg, comment=f"{avg:.0%} correct")
dataset = langfuse.get_dataset(DATASET)
result = dataset.run_experiment(
   name="capitals-baseline",
   description="Baseline run from the Colab tutorial",
   task=capital_task,
   evaluators=[accuracy, conciseness],
   run_evaluators=[mean_accuracy],
   max_concurrency=4,
)
print(result.format())



Source_link

READ ALSO

Galbot Robots Complete 100 Consecutive Autonomous Tennis Rallies – Unite.AI

Harvey Introduces Harvey Tenet: A Kimi K3 Base Post-Trained with Fireworks for Long-Horizon Legal Agent Work

Related Posts

Galbot Robots Complete 100 Consecutive Autonomous Tennis Rallies – Unite.AI
Al, Analytics and Automation

Galbot Robots Complete 100 Consecutive Autonomous Tennis Rallies – Unite.AI

August 24, 2026
Harvey Introduces Harvey Tenet: A Kimi K3 Base Post-Trained with Fireworks for Long-Horizon Legal Agent Work
Al, Analytics and Automation

Harvey Introduces Harvey Tenet: A Kimi K3 Base Post-Trained with Fireworks for Long-Horizon Legal Agent Work

August 23, 2026
10 Best AI Visibility Tools for Tracking Brand Mentions and Citations (August 2026) – Unite.AI
Al, Analytics and Automation

10 Best AI Visibility Tools for Tracking Brand Mentions and Citations (August 2026) – Unite.AI

August 23, 2026
Al, Analytics and Automation

The Developer’s Guide to NeMo Guardrails for Enterprise AI Safety

August 23, 2026
Study Finds Frontier AI Labs Have Few Plans to Contain Rogue Models – Unite.AI
Al, Analytics and Automation

Study Finds Frontier AI Labs Have Few Plans to Contain Rogue Models – Unite.AI

August 22, 2026
Decoding AI’s Open-Source Course Maps Three Ways to Run an Agent Loop and the Provider Economics Behind Each
Al, Analytics and Automation

Decoding AI’s Open-Source Course Maps Three Ways to Run an Agent Loop and the Provider Economics Behind Each

August 22, 2026
Next Post
Why short clips are taking over your social media feed

Why short clips are taking over your social media feed

POPULAR NEWS

Trump ends trade talks with Canada over a digital services tax

Trump ends trade talks with Canada over a digital services tax

June 28, 2025
15 Trending Songs on TikTok in 2025 (+ How to Use Them)

15 Trending Songs on TikTok in 2025 (+ How to Use Them)

June 18, 2025
Communication Effectiveness Skills For Business Leaders

Communication Effectiveness Skills For Business Leaders

June 10, 2025
Comparing the Top 7 Large Language Models LLMs/Systems for Coding in 2025

Comparing the Top 7 Large Language Models LLMs/Systems for Coding in 2025

November 4, 2025
App Development Cost in Singapore: Pricing Breakdown & Insights

App Development Cost in Singapore: Pricing Breakdown & Insights

June 22, 2025

EDITOR'S PICK

Q&A: A roadmap for revolutionizing health care through data-driven innovation | MIT News

Q&A: A roadmap for revolutionizing health care through data-driven innovation | MIT News

June 26, 2025
7 Best Free Video Conferencing Software for Remote Teams in 2026

7 Best Free Video Conferencing Software for Remote Teams in 2026

May 16, 2026
How To Launch Effective Awareness Campaigns For Responsible Gambling

How To Launch Effective Awareness Campaigns For Responsible Gambling

October 7, 2025
How to Plan an Executive Offsite: Step-by-Step Guide for EAs and Chiefs of Staff

How to Plan an Executive Offsite: Step-by-Step Guide for EAs and Chiefs of Staff

July 7, 2025

About

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Check our landing page for details.

Follow us

Categories

  • Account Based Marketing
  • Ad Management
  • Al, Analytics and Automation
  • Brand Management
  • Channel Marketing
  • Digital Marketing
  • Direct Marketing
  • Event Management
  • Google Marketing
  • Marketing Attribution and Consulting
  • Marketing Automation
  • Mobile Marketing
  • PR Solutions
  • Social Media Management
  • Technology And Software
  • Uncategorized

Recent Posts

  • INTERVIEW: True Loyalty, with Aaron Dauphinee, Partner, The Wise Marketer Group
  • How to take full-length practice SAT tests in the Gemini app
  • Enterprise AI agents are only as reliable as the messiest documents behind them
  • Galbot Robots Complete 100 Consecutive Autonomous Tennis Rallies – Unite.AI
  • About Us
  • Disclaimer
  • Contact Us
  • Privacy Policy
No Result
View All Result
  • Technology And Software
    • Account Based Marketing
    • Channel Marketing
    • Marketing Automation
      • Al, Analytics and Automation
      • Ad Management
  • Digital Marketing
    • Social Media Management
    • Google Marketing
  • Direct Marketing
    • Brand Management
    • Marketing Attribution and Consulting
  • Mobile Marketing
  • Event Management
  • PR Solutions