- 필수 기능
- 시작하기
- Glossary
- 표준 속성
- Guides
- Agent
- 통합
- 개방형텔레메트리
- 개발자
- Administrator's Guide
- API
- Datadog Mobile App
- CoScreen
- Cloudcraft
- 앱 내
- 서비스 관리
- 인프라스트럭처
- 애플리케이션 성능
- APM
- Continuous Profiler
- 스팬 시각화
- 데이터 스트림 모니터링
- 데이터 작업 모니터링
- 디지털 경험
- 소프트웨어 제공
- 보안
- AI Observability
- 로그 관리
- 관리
Learn how to use Datadog’s integration with the Ragas framework to evaluate your LLM application. For more information about the Ragas integration, including a detailed setup guide, see Ragas Evaluations.
Install required dependencies:
pip install ragas==0.1.21 openai ddtrace>=3.0.0
Create a file named quickstart.py
with the following code:
import os
from ddtrace.llmobs import LLMObs
from ddtrace.llmobs.utils import Prompt
from openai import OpenAI
LLMObs.enable(
ml_app="test-rag-app",
agentless_enabled=True,
)
oai_client = OpenAI(api_key=os.environ.get("OPENAI_API_KEY"))
rag_context = "The First AFL–NFL World Championship Game was an American football game played on January 15, 1967, at the Los Angeles Memorial Coliseum in Los Angeles"
with LLMObs.annotation_context(
prompt=Prompt(variables={"context": rag_context}),
):
completion = oai_client.chat.completions.create(
model="gpt-3.5-turbo",
messages=[
{"role": "system", "content": "Answer the user's question given the following context information {}".format(rag_context)},
{"role": "user", "content": "When was the first superbowl?"},
],
)
Run the script with the Ragas Faithfulness evaluation enabled:
DD_LLMOBS_EVALUATORS=ragas_faithfulness DD_ENV=dev DD_API_KEY=<YOUR-DD-API-KEY> DD_SITE=datadoghq.com python quickstart.py
View your results in Datadog at https://<YOUR-DATADOG-SITE-URL>/llm/traces?query=%40ml_app%3Atest-rag-app
.
추가 유용한 문서, 링크 및 기사: