Spaces:
Running
Running
Download api/models/responses.py from Yash030/claude-code-proxy: direct link, hf CLI and curl.
- Browser
- Download file 1.2 kB
-
https://huggingface.co/spaces/Yash030/claude-code-proxy/resolve/main/api/models/responses.py
- Command line
-
hf download hf://spaces/Yash030/claude-code-proxy/api/models/responses.py
-
curl -L -o responses.py https://huggingface.co/spaces/Yash030/claude-code-proxy/resolve/main/api/models/responses.py
1.2 kB
| """Pydantic models for API responses.""" | |
| from typing import Any, Literal | |
| from pydantic import BaseModel | |
| from .anthropic import ( | |
| ContentBlockRedactedThinking, | |
| ContentBlockText, | |
| ContentBlockThinking, | |
| ContentBlockToolUse, | |
| ) | |
| class TokenCountResponse(BaseModel): | |
| input_tokens: int | |
| class ModelResponse(BaseModel): | |
| created_at: str | |
| display_name: str | |
| id: str | |
| type: Literal["model"] = "model" | |
| class ModelsListResponse(BaseModel): | |
| data: list[ModelResponse] | |
| first_id: str | None | |
| has_more: bool | |
| last_id: str | None | |
| class Usage(BaseModel): | |
| input_tokens: int | |
| output_tokens: int | |
| cache_creation_input_tokens: int = 0 | |
| cache_read_input_tokens: int = 0 | |
| class MessagesResponse(BaseModel): | |
| id: str | |
| model: str | |
| role: Literal["assistant"] = "assistant" | |
| content: list[ | |
| ContentBlockText | |
| | ContentBlockToolUse | |
| | ContentBlockThinking | |
| | ContentBlockRedactedThinking | |
| | dict[str, Any] | |
| ] | |
| type: Literal["message"] = "message" | |
| stop_reason: ( | |
| Literal["end_turn", "max_tokens", "stop_sequence", "tool_use"] | None | |
| ) = None | |
| stop_sequence: str | None = None | |
| usage: Usage | |