Azure AI Foundry에서의 RAG
Azure AI Foundry에서의 RAG
이 페이지는 Azure AI Foundry에서 Cohere의 RAG를 사용하는 방법을 설명해요. 문서를 구성해 Cohere 클라이언트에 전달해 RAG 기능을 활용하는 과정을 살펴볼게요.
출처: 문서
본문
이 페이지는 Azure AI Foundry에서 Cohere의 RAG (Retrieval-Augmented Generation)를 사용하는 방법을 설명해요.
RAG 사용하기 (Using RAG)
문서를 구성하고 Cohere 클라이언트에 전달해 RAG 기능을 활용할 수 있어요.
Cohere SDK로 RAG를 사용하는 코드 스니펫은 다음과 같아요:
PYTHON
import cohere
co = cohere.Client(
api_key="key",
base_url="https://your-endpoint.inference.ai.azure.com/v1/chat",
}
faqs_short = [
{
"text": "Reimbursing Travel Expenses: Easily manage your travel expenses by submitting them through our finance tool. Approvals are prompt and straightforward."
},
{
"text": "Health and Wellness Benefits: We care about your well-being and offer gym memberships, on-site yoga classes, and comprehensive health insurance."
},
]
query = "Are there fitness-related perks?"
response = co.chat(
message=query,
documents=faqs_short,
}
print(response.text)
Python 패키지 (Python packages)
다음 패키지가 설치되어 있는지 확인하세요:
azure-ai-inferencecohere
다음 단계 (Next Steps)
계속 탐색해 보세요: