1. Getting Started
Power Guard AI
  • Getting Started
    • hello-powerguard (starts here!)
    • ai-controller-guide
    • chat-controller-guide
    • health-controller-guide
    • models-controller-guide
    • usage-controller-guide
  • AI
    • Generate AI responses for form fields
      POST
    • Generate AI text completion
      POST
    • Generate embeddings for input text
      POST
  • Chat
    • Process chat completions
      POST
    • Process chat completions
      POST
  • Health
    • Check API health status
      GET
  • Models
    • List all available models
      GET
    • Get specific model information
      GET
  • Usage
    • Get API usage statistics
      GET
    • Get API usage statistics
      POST
  • Esquemas
    • Schemas
    • CompletionRequest
    • ChatCompletionChoice
    • EmbeddingRequest
    • ChatCompletionFunction
    • FunctionParameters
    • ChatCompletionMessage
    • Message
    • ChatCompletionResponse
    • QuestionModel
    • ChatCompletionToolCall
    • QuestionRequest
    • ChatCompletionUsage
    • Choice
    • QuestionValidationRules
    • Tool
    • ChoiceMessage
    • ToolFunction
    • CompletionResponse
    • DataItem
    • EmbeddingResponse
    • HealthResponseModel
    • ModelCapabilities
    • ModelInfo
    • ResponseModel
    • Role
    • SingleReadOnlyMemory
    • SingleReadOnlySpan
    • Usage
    • UsageModel
    • UsageRequest
  1. Getting Started

chat-controller-guide

πŸ’¬ Chat Controller Guide#

OpenAI compatible. Easy to integrate. Zero learning curve.
The Chat Controller is compatible with the OpenAI chat completion API. Same interface, same response format, making migration easy and straightforward.

🎯 When to Use This Controller#

Integrating conversational AI into your applications
Building chatbots with standard chat completion format
Streaming responses for a better user experience
Supporting multiple language models through a single API
Compatibility with OpenAI SDK/libraries you're already using

πŸš€ Endpoints#

POST /chat/completions#

POST /v1/chat/completions#

Both endpoints are identical - use whichever matches your existing code

πŸ”„ Migration in 30 Seconds#

Using Python OpenAI SDK#

Using LangChain SOON#

Using Node.js OpenAI SDK#

πŸ“‹ Request Schema#

πŸ“‹ Response Schema#

🌊 Streaming Responses#

πŸ”§ Function Calling#

πŸ›‘οΈ Compliance Features SOON#

Automatic PII Protection SOON#

Content Filtering SOON#

🎨 Usage Examples#

Basic Chat Bot#

Domain-Specific Assistant SOON#

Multi-turn Conversations#

πŸ“Š Response Enhancements#

🚨 Error Handling#

🎯 Best Practices#

1. Use System Messages Wisely#

2. Implement Retry Logic#

3. Track Usage Efficiently SOON#

πŸ“š SDK Support#

We're compatible with all major OpenAI SDKs and libraries:
βœ… OpenAI Python SDK
βœ… OpenAI Node.js SDK
βœ… LangChain
βœ… LlamaIndex
βœ… Vercel AI SDK
βœ… Microsoft Semantic Kernel
βœ… Any HTTP client

🎁 Pro Tips#

1.
Use streaming for UX: Users love seeing responses appear in real-time
2.
Set user IDs: Better tracking, better compliance
3.
Lower temperature for consistency: Especially for customer-facing bots
4.
Cache system prompts: They don't change often
5.
Monitor finish_reason: Handle length limits gracefully

Migration Checklist:
Get your Power Guard API key
Change base URL in your code
Test with a simple request
Enable compliance features as needed
Celebrate - you're now compliant! πŸŽ‰
*Need help migrating? Email us
Modificado emΒ 2025-07-16 20:18:41
PΓ‘gina anterior
ai-controller-guide
PrΓ³xima pΓ‘gina
health-controller-guide
Built with