diff --git a/.fern/metadata.json b/.fern/metadata.json index a1c6702..3c97467 100644 --- a/.fern/metadata.json +++ b/.fern/metadata.json @@ -5,5 +5,5 @@ "generatorConfig": { "client_class_name": "PhenomlClient" }, - "sdkVersion": "8.0.0" + "sdkVersion": "8.0.1" } \ No newline at end of file diff --git a/README.md b/README.md index ee9c77f..ffa6d80 100644 --- a/README.md +++ b/README.md @@ -20,18 +20,18 @@ A full reference for this library is available [here](https://github.com/phenoml Instantiate and use the client with the following: ```python -from phenoml import Client +from phenoml import PhenomlClient -client = Client( - username="your_username", - password="your_password", - base_url="https://your-phenoml-instance.com" +client = PhenomlClient( + client_id="YOUR_CLIENT_ID", + client_secret="YOUR_CLIENT_SECRET", + base_url="https://yourinstance.app.pheno.ml", ) client.agent.create( name="name", + provider="provider_id", prompts=["prompt_123", "prompt_456"], - is_active=True, ) ``` @@ -42,21 +42,20 @@ The SDK also exports an `async` client so that you can make non-blocking calls t ```python import asyncio -from phenoml import AsyncClient +from phenoml import AsyncPhenomlClient -client = AsyncClient( - username="your_username", - password="your_password", - base_url="https://your-phenoml-instance.com" +client = AsyncPhenomlClient( + client_id="YOUR_CLIENT_ID", + client_secret="YOUR_CLIENT_SECRET", + base_url="https://yourinstance.app.pheno.ml", ) async def main() -> None: - await client.initialize() # Generate token from username/password await client.agent.create( name="name", + provider="provider_id", prompts=["prompt_123", "prompt_456"], - is_active=True, ) @@ -86,10 +85,12 @@ The SDK provides access to raw response data, including headers, through the `.w The `.with_raw_response` property returns a "raw" client that can be used to access the `.headers` and `.data` attributes. ```python -from phenoml import phenoml +from phenoml import PhenomlClient -client = phenoml( - ..., +client = PhenomlClient( + client_id="YOUR_CLIENT_ID", + client_secret="YOUR_CLIENT_SECRET", + base_url="https://yourinstance.app.pheno.ml", ) response = client.agent.with_raw_response.create(...) print(response.headers) # access the response headers @@ -121,11 +122,12 @@ client.agent.create(..., request_options={ The SDK defaults to a 60 second timeout. You can configure this with a timeout option at the client or request level. ```python +from phenoml import PhenomlClient -from phenoml import phenoml - -client = phenoml( - ..., +client = PhenomlClient( + client_id="YOUR_CLIENT_ID", + client_secret="YOUR_CLIENT_SECRET", + base_url="https://yourinstance.app.pheno.ml", timeout=20.0, ) @@ -143,10 +145,12 @@ and transports. ```python import httpx -from phenoml import phenoml +from phenoml import PhenomlClient -client = phenoml( - ..., +client = PhenomlClient( + client_id="YOUR_CLIENT_ID", + client_secret="YOUR_CLIENT_SECRET", + base_url="https://yourinstance.app.pheno.ml", httpx_client=httpx.Client( proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), diff --git a/pyproject.toml b/pyproject.toml index be0c282..1311071 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ dynamic = ["version"] [tool.poetry] name = "phenoml" -version = "8.0.0" +version = "8.0.1" description = "" readme = "README.md" authors = [] diff --git a/src/phenoml/core/client_wrapper.py b/src/phenoml/core/client_wrapper.py index 5341ea9..ca2bdb3 100644 --- a/src/phenoml/core/client_wrapper.py +++ b/src/phenoml/core/client_wrapper.py @@ -27,12 +27,12 @@ def get_headers(self) -> typing.Dict[str, str]: import platform headers: typing.Dict[str, str] = { - "User-Agent": "phenoml/8.0.0", + "User-Agent": "phenoml/8.0.1", "X-Fern-Language": "Python", "X-Fern-Runtime": f"python/{platform.python_version()}", "X-Fern-Platform": f"{platform.system().lower()}/{platform.release()}", "X-Fern-SDK-Name": "phenoml", - "X-Fern-SDK-Version": "8.0.0", + "X-Fern-SDK-Version": "8.0.1", **(self.get_custom_headers() or {}), } token = self._get_token()