Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .fern/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
"generatorConfig": {
"client_class_name": "PhenomlClient"
},
"sdkVersion": "8.0.0"
"sdkVersion": "8.0.1"
}
50 changes: 27 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
)
```

Expand All @@ -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,
)


Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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,
)

Expand All @@ -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"),
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ dynamic = ["version"]

[tool.poetry]
name = "phenoml"
version = "8.0.0"
version = "8.0.1"
description = ""
readme = "README.md"
authors = []
Expand Down
4 changes: 2 additions & 2 deletions src/phenoml/core/client_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Loading