MCPcopy Create free account
hub / github.com/OpenRaiser/PaperFlow / __init__

Method __init__

paperflow/providers/embedding.py:54–66  ·  view source on GitHub ↗
(
        self,
        model: str,
        dimensions: int,
        api_key: str,
        base_url: Optional[str] = None,
        timeout: float = 60.0,
    )

Source from the content-addressed store, hash-verified

52 name = "openai"
53
54 def __init__(
55 self,
56 model: str,
57 dimensions: int,
58 api_key: str,
59 base_url: Optional[str] = None,
60 timeout: float = 60.0,
61 ) -> None:
62 from openai import OpenAI # local import keeps dependency optional
63
64 self.model = model
65 self.dimensions = dimensions
66 self._client = OpenAI(api_key=api_key, base_url=base_url, timeout=timeout)
67
68 def embed(self, text: str) -> List[float]:
69 return self.embed_batch([text])[0]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected