Prediction Guard는 민감한 데이터를 보호하고, 일반적인 AI 오작동을 방지하며, 저렴한 하드웨어에서 실행되는 안전하고 확장 가능한 GenAI 플랫폼입니다.
Overview
Integration details
이 integration은 다양한 보호 장치와 보안 기능을 포함하는 Prediction Guard API를 활용합니다.Model features
이 integration에서 지원하는 model들은 현재 text-generation 기능만 제공하며, 여기에 설명된 입력 및 출력 검사 기능을 포함합니다.Setup
Prediction Guard model에 액세스하려면 여기에서 문의하여 Prediction Guard API key를 받고 시작하세요.Credentials
key를 받으면 다음과 같이 설정할 수 있습니다Installation
다음 명령으로 Prediction Guard LangChain integration을 설치하세요Instantiation
Invocation
Streaming
Tool Calling
Prediction Guard는 tool과 그 argument를 설명할 수 있는 tool calling API를 제공하며, 이를 통해 model이 호출할 tool과 해당 tool의 입력값을 포함하는 JSON object를 반환할 수 있습니다. Tool-calling은 tool을 사용하는 chain과 agent를 구축하고, 보다 일반적으로 model에서 구조화된 출력을 얻는 데 매우 유용합니다.ChatPredictionGuard.bind_tools()
ChatPredictionGuard.bind_tools()를 사용하면 Pydantic class, dict schema, LangChain tool을 model의 tool로 전달할 수 있으며, 이들은 model에서 사용할 수 있도록 재구성됩니다.
AIMessage.tool_calls
AIMessage에 tool_calls attribute가 있음을 주목하세요. 이는 model-provider에 구애받지 않는 표준화된 ToolCall 형식을 포함합니다.Process Input
Prediction Guard를 사용하면 입력 검사 중 하나를 사용하여 PII 또는 prompt injection에 대해 model 입력을 보호할 수 있습니다. 자세한 내용은 Prediction Guard docs를 참조하세요.PII
Prompt Injection
Output Validation
Prediction Guard를 사용하면 factuality를 사용하여 환각(hallucination)과 잘못된 정보를 방지하고, toxicity를 사용하여 유해한 응답(예: 욕설, 혐오 발언)을 방지하여 model 출력을 검증할 수 있습니다. 자세한 내용은 Prediction Guard docs를 참조하세요.Toxicity
Factuality
Chaining
API reference
모든 ChatPredictionGuard 기능 및 구성에 대한 자세한 문서는 API reference를 확인하세요: python.langchain.com/api_reference/community/chat_models/langchain_community.chat_models.predictionguard.ChatPredictionGuard.htmlConnect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.