Skip to content

Commit dbc89d2

Browse files
committed
Use abstract base classes in sources
1 parent 31cb292 commit dbc89d2

9 files changed

Lines changed: 17 additions & 10 deletions

File tree

src/app/endpoints/a2a.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
import uuid
66
from collections.abc import Mapping
77
from datetime import datetime, timezone
8-
from typing import Annotated, Any, AsyncIterator, MutableMapping, Optional
8+
from typing import Annotated, Any, Optional
9+
from collections.abc import AsyncIterator, MutableMapping
910

1011
from a2a.server.agent_execution import AgentExecutor, RequestContext
1112
from a2a.server.apps import A2AStarletteApplication

src/app/endpoints/streaming_query.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
import asyncio
44
import datetime
55
import json
6-
from typing import Annotated, Any, AsyncIterator, Optional, cast
6+
from typing import Annotated, Any, Optional, cast
7+
from collections.abc import AsyncIterator
78

89
from fastapi import APIRouter, Depends, HTTPException, Request
910
from fastapi.responses import StreamingResponse

src/app/main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
import os
44
from contextlib import asynccontextmanager
5-
from typing import AsyncIterator
5+
from collections.abc import AsyncIterator
66

77
from fastapi import FastAPI, HTTPException
88
from fastapi.middleware.cors import CORSMiddleware

src/authentication/jwk_token.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import json
44
from asyncio import Lock
5-
from typing import Any, Callable
5+
from typing import Any
6+
from collections.abc import Callable
67

78
import aiohttp
89
from authlib.jose import JsonWebKey, Key, KeySet, jwt

src/authorization/middleware.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
"""Authorization middleware and decorators."""
22

33
from functools import lru_cache, wraps
4-
from typing import Any, Callable, Optional
4+
from typing import Any, Optional
5+
from collections.abc import Callable
56

67
from fastapi import HTTPException
78
from starlette.requests import Request

src/models/config.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@
66
from enum import Enum
77
from functools import cached_property
88
from pathlib import Path
9-
from typing import Any, Optional, Pattern
9+
from typing import Any, Optional
10+
from re import Pattern
1011

1112
import jsonpath_ng
1213
import yaml
@@ -25,7 +26,7 @@
2526
model_validator,
2627
)
2728
from pydantic.dataclasses import dataclass
28-
from typing_extensions import Literal, Self
29+
from typing import Literal, Self
2930

3031
import constants
3132
from log import get_logger

src/models/requests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
from enum import Enum
44
from typing import Optional, Any
5-
from typing_extensions import Self
5+
from typing import Self
66

77
from llama_stack_api.openai_responses import (
88
OpenAIResponseInputToolChoice as ToolChoice,

src/utils/common.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
import asyncio
44
from functools import wraps
5-
from typing import Any, Callable, cast
5+
from typing import Any, cast
6+
from collections.abc import Callable
67
from logging import Logger
78

89
from llama_stack_client import AsyncLlamaStackClient

src/utils/connection_decorator.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
"""Decorator that makes sure the object is 'connected' according to it's connected predicate."""
22

3-
from typing import Any, Callable
3+
from typing import Any
4+
from collections.abc import Callable
45

56

67
def connection(f: Callable) -> Callable:

0 commit comments

Comments
 (0)