| 16 | content: str |
| 17 | |
| 18 | class TypeChatLanguageModel(Protocol): |
| 19 | async def complete(self, prompt: str | list[PromptSection]) -> Result[str]: |
| 20 | """ |
| 21 | Represents a AI language model that can complete prompts. |
| 22 | |
| 23 | TypeChat uses an implementation of this protocol to communicate |
| 24 | with an AI service that can translate natural language requests to JSON |
| 25 | instances according to a provided schema. |
| 26 | The `create_language_model` function can create an instance. |
| 27 | """ |
| 28 | ... |
| 29 | |
| 30 | _TRANSIENT_ERROR_CODES = [ |
| 31 | 429, |
nothing calls this directly
no outgoing calls
no test coverage detected