removed other direct httpx references

This commit is contained in:
Kazgatari
2026-06-30 18:54:38 +02:00
parent dfa9c70a25
commit a0cd8d0904
8 changed files with 2 additions and 52 deletions
@@ -8,7 +8,7 @@ Usage (run once from project root):
"""
from sentence_transformers import SentenceTransformer
MODEL_NAME = "paraphrase-multilingual-mpnet-base-v2"
MODEL_NAME = "intfloat/multilingual-e5-base"
print(f"Downloading '{MODEL_NAME}' to default cache directory...")
model = SentenceTransformer(MODEL_NAME)
print("Done.")
@@ -1,7 +1,5 @@
from typing import Any
import httpx
from .. import config
@@ -16,18 +14,10 @@ from inse.exceptions import MissingApiKeyError
class CompanyConnectionsSearchClient:
def __init__(
self,
base_url: str | None = None,
api_key: str | None = None,
openalex_index: str = "openalex-authors",
handelsregister_index: str = "handelsregister",
timeout: float = 30.0,
transport: httpx.AsyncBaseTransport | None = None,
):
self.base_url = (
base_url
or config.settings.elasticsearch_url
or ""
).rstrip("/")
self.api_key = (
api_key
if api_key is not None
@@ -35,8 +25,6 @@ class CompanyConnectionsSearchClient:
)
self.openalex_index = openalex_index
self.handelsregister_index = handelsregister_index
self.timeout = timeout
self.transport = transport
@staticmethod
def openalex_doc_id(author_id: str) -> str:
+1 -1
View File
@@ -46,7 +46,7 @@ class Settings(BaseSettings):
llm_model: Optional[str] = None
# Sentence Transformers config
sentence_transformers_model_name: str = "paraphrase-multilingual-mpnet-base-v2"
sentence_transformers_model_name: str = "intfloat/multilingual-e5-base"
# Elasticsearch config
elasticsearch_url: str = "https://project.nes.uni-due.de/elastic"
@@ -5,8 +5,6 @@
"""
from typing import Any
import httpx
from .. import config
from inse.integrations import elasticsearch
from inse.model import ESCluster
@@ -18,17 +16,11 @@ from inse.exceptions import MissingApiKeyError
class FundedPublicationsSearchClient:
def __init__(
self,
base_url: str | None = None,
index: str | None = None,
api_key: str | None = None,
timeout: float | None = None,
transport: httpx.AsyncBaseTransport | None = None,
):
self.base_url = (base_url or config.settings.elasticsearch_url or "").rstrip("/")
self.index = index or config.settings.openalex_works_search_index
self.api_key = api_key if api_key is not None else config.settings.elasticsearch_api_key
self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds
self.transport = transport
@staticmethod
def indexed_author_id(author_id: str) -> str:
@@ -5,8 +5,6 @@
"""
from typing import Any
import httpx
from .. import config
from inse.exceptions import MissingApiKeyError
@@ -20,15 +18,9 @@ USPTO_INDEX = "uspto_patents_3.0"
class AllPatentsSearchClient:
def __init__(
self,
base_url: str | None = None,
api_key: str | None = None,
timeout: float = 30.0,
transport: httpx.AsyncBaseTransport | None = None,
):
self.base_url = (base_url or config.settings.patent_elasticsearch_url).rstrip("/")
self.api_key = api_key if api_key is not None else config.settings.patent_elasticsearch_api_key
self.timeout = timeout
self.transport = transport
def _headers(self) -> dict[str, str]:
if not self.api_key:
@@ -6,7 +6,6 @@
from typing import Any
from inse.integrations import elasticsearch
from inse.model import ESCluster, ESIndex
import httpx
import asyncio
from .. import config
from .name_matching import search_name_variants
@@ -33,15 +32,9 @@ from inse.exceptions import MissingApiKeyError
class PatentSearchClient:
def __init__(
self,
base_url: str | None = None,
api_key: str | None = None,
timeout: float = 30.0,
transport: httpx.AsyncBaseTransport | None = None,
):
self.base_url = (base_url or config.settings.patent_elasticsearch_url).rstrip("/")
self.api_key = api_key if api_key is not None else config.settings.patent_elasticsearch_api_key
self.timeout = timeout
self.transport = transport
def _headers(self) -> dict[str, str]:
if not self.api_key:
@@ -7,8 +7,6 @@ from __future__ import annotations
from typing import Any
import httpx
from .. import config
from . import model
from inse.exceptions import MissingApiKeyError
@@ -32,15 +30,9 @@ _LEVELS: tuple[tuple[str, str, str], ...] = (
class IpcSearchClient:
def __init__(
self,
base_url: str | None = None,
api_key: str | None = None,
timeout: float = 30.0,
transport: httpx.AsyncBaseTransport | None = None,
):
self.base_url = (base_url or config.settings.patent_elasticsearch_url).rstrip("/")
self.api_key = api_key if api_key is not None else config.settings.patent_elasticsearch_api_key
self.timeout = timeout
self.transport = transport
def _headers(self) -> dict[str, str]:
if not self.api_key:
@@ -6,7 +6,6 @@
import logging
from typing import Any
import httpx
import urllib
from .. import config
from inse.integrations import elasticsearch
@@ -19,17 +18,11 @@ logger = logging.getLogger(__name__)
class OpenAlexWorksSearchClient:
def __init__(
self,
base_url: str | None = None,
index: str | None = None,
api_key: str | None = None,
timeout: float | None = None,
transport: httpx.AsyncBaseTransport | None = None,
):
self.base_url = (base_url or config.settings.elasticsearch_url or "").rstrip("/")
self.index = index or config.settings.openalex_works_search_index
self.api_key = api_key if api_key is not None else config.settings.elasticsearch_api_key
self.timeout = timeout if timeout is not None else config.settings.openalex_works_search_timeout_seconds
self.transport = transport
def author_works_query(