INNER CODE UNIT · Python
chat
ai-infra-curriculum/ai-infra-engineer-learning · projects/project-103-llm-deployment/src/llm/server.py:378
async def chat(
self,
messages: List[Dict[str, str]],
**generation_kwargs
) -> str:
"""
Generate response for a chat conversation.
Args:
messages: List of message dicts with 'role' and 'content'
Example: [{"role": "user", "content": "Hello!"}]
**generation_kwargs: Generation parameters
Returns:
Generated response text
TODO: Implement chat functionality:
1. Validate message format