Best Practices
Best practices and recommendations
Best Practices
Do's
- Use dependency injection for services
- Handle exceptions properly
- Use async/await consistently
- Validate user input
- Set reasonable maxResults limits
- Use conversation history for natural interactions
- Test database connections before deployment
Don'ts
- Don't use .Result or .Wait() on async methods
- Don't commit API keys to source control
- Don't use InMemory storage in production
- Don't skip error handling
- Don't query databases without row limits
- Don't upload sensitive data without sanitization
- Don't forget to dispose streams
Related Examples
- Examples Index - Back to Examples categories