Skip to content

release: 0.1.0-alpha.5 #31

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jan 22, 2025
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 .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.1.0-alpha.4"
".": "0.1.0-alpha.5"
}
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## 0.1.0-alpha.5 (2025-01-22)

Full Changelog: [v0.1.0-alpha.4...v0.1.0-alpha.5](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.4...v0.1.0-alpha.5)

### Features

* **api:** api update ([#30](https://github.com/cleanlab/codex-python/issues/30)) ([13e6f7c](https://github.com/cleanlab/codex-python/commit/13e6f7c566ecdf91ae576f6bdba03b883d43ee21))
* **api:** api update ([#33](https://github.com/cleanlab/codex-python/issues/33)) ([038e1d0](https://github.com/cleanlab/codex-python/commit/038e1d0f548c90530efcdcc40b84728640d86cc1))
* **api:** update prod api url ([#32](https://github.com/cleanlab/codex-python/issues/32)) ([58ef0f2](https://github.com/cleanlab/codex-python/commit/58ef0f2fd8243f7bf8a1d11962b254e2624dba1f))

## 0.1.0-alpha.4 (2025-01-21)

Full Changelog: [v0.1.0-alpha.3...v0.1.0-alpha.4](https://github.com/cleanlab/codex-python/compare/v0.1.0-alpha.3...v0.1.0-alpha.4)
Expand Down
2 changes: 1 addition & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ Methods:
- <code title="put /api/projects/{project_id}/access_keys/{access_key_id}">client.projects.access_keys.<a href="./src/codex/resources/projects/access_keys.py">update</a>(access_key_id, \*, project_id, \*\*<a href="src/codex/types/projects/access_key_update_params.py">params</a>) -> <a href="./src/codex/types/projects/access_key_schema.py">AccessKeySchema</a></code>
- <code title="get /api/projects/{project_id}/access_keys/">client.projects.access_keys.<a href="./src/codex/resources/projects/access_keys.py">list</a>(project_id) -> <a href="./src/codex/types/projects/access_key_list_response.py">AccessKeyListResponse</a></code>
- <code title="delete /api/projects/{project_id}/access_keys/{access_key_id}">client.projects.access_keys.<a href="./src/codex/resources/projects/access_keys.py">delete</a>(access_key_id, \*, project_id) -> None</code>
- <code title="get /api/projects/id_from_access_key">client.projects.access_keys.<a href="./src/codex/resources/projects/access_keys.py">retrieve_project_id</a>() -> str</code>
- <code title="get /api/projects/id_from_access_key">client.projects.access_keys.<a href="./src/codex/resources/projects/access_keys.py">retrieve_project_id</a>() -> <a href="./src/codex/types/projects/access_key_retrieve_project_id_response.py">AccessKeyRetrieveProjectIDResponse</a></code>
- <code title="post /api/projects/{project_id}/access_keys/{access_key_id}/revoke">client.projects.access_keys.<a href="./src/codex/resources/projects/access_keys.py">revoke</a>(access_key_id, \*, project_id) -> None</code>

## Entries
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "codex-sdk"
version = "0.1.0-alpha.4"
version = "0.1.0-alpha.5"
description = "The official Python library for the Codex API"
dynamic = ["readme"]
license = "MIT"
Expand Down
2 changes: 1 addition & 1 deletion src/codex/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
]

ENVIRONMENTS: Dict[str, str] = {
"production": "https://api-codex-o3gxj3oajfu.cleanlab.ai",
"production": "https://api-codex.cleanlab.ai",
"staging": "https://api-codex-staging-o3gxj3oajfu.cleanlab.ai",
"local": "http://localhost:8080",
}
Expand Down
2 changes: 1 addition & 1 deletion src/codex/_version.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

__title__ = "codex"
__version__ = "0.1.0-alpha.4" # x-release-please-version
__version__ = "0.1.0-alpha.5" # x-release-please-version
9 changes: 5 additions & 4 deletions src/codex/resources/projects/access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@
from ...types.projects import access_key_create_params, access_key_update_params
from ...types.projects.access_key_schema import AccessKeySchema
from ...types.projects.access_key_list_response import AccessKeyListResponse
from ...types.projects.access_key_retrieve_project_id_response import AccessKeyRetrieveProjectIDResponse

__all__ = ["AccessKeysResource", "AsyncAccessKeysResource"]

Expand Down Expand Up @@ -254,14 +255,14 @@ def retrieve_project_id(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> str:
) -> AccessKeyRetrieveProjectIDResponse:
"""Get the project ID from an access key."""
return self._get(
"/api/projects/id_from_access_key",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=str,
cast_to=AccessKeyRetrieveProjectIDResponse,
)

def revoke(
Expand Down Expand Up @@ -528,14 +529,14 @@ async def retrieve_project_id(
extra_query: Query | None = None,
extra_body: Body | None = None,
timeout: float | httpx.Timeout | None | NotGiven = NOT_GIVEN,
) -> str:
) -> AccessKeyRetrieveProjectIDResponse:
"""Get the project ID from an access key."""
return await self._get(
"/api/projects/id_from_access_key",
options=make_request_options(
extra_headers=extra_headers, extra_query=extra_query, extra_body=extra_body, timeout=timeout
),
cast_to=str,
cast_to=AccessKeyRetrieveProjectIDResponse,
)

async def revoke(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
# File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.

from typing_extensions import TypeAlias

from ..._models import BaseModel

__all__ = ["AccessKeyRetrieveProjectIDResponse"]

AccessKeyRetrieveProjectIDResponse: TypeAlias = str

class AccessKeyRetrieveProjectIDResponse(BaseModel):
project_id: str
16 changes: 15 additions & 1 deletion src/codex/types/users/user_schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,28 @@
class UserSchema(BaseModel):
id: str

account_activated_at: Optional[datetime] = None

api_key: str

api_key_timestamp: datetime

created_at: datetime

discovery_source: Optional[str] = None

email: str

updated_at: datetime

user_provided_company_name: Optional[str] = None

first_name: Optional[str] = None

is_account_activated: Optional[bool] = None

last_name: Optional[str] = None

name: Optional[str] = None

updated_at: datetime
phone_number: Optional[str] = None
10 changes: 9 additions & 1 deletion src/codex/types/users/user_schema_public.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,14 @@ class UserSchemaPublic(BaseModel):

email: str

email_verified: Optional[bool] = None

first_name: Optional[str] = None

is_account_activated: Optional[bool] = None

last_name: Optional[str] = None

name: Optional[str] = None

email_verified: Optional[bool] = None
phone_number: Optional[str] = None
13 changes: 7 additions & 6 deletions tests/api_resources/projects/test_access_keys.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from codex.types.projects import (
AccessKeySchema,
AccessKeyListResponse,
AccessKeyRetrieveProjectIDResponse,
)

base_url = os.environ.get("TEST_API_BASE_URL", "http://127.0.0.1:4010")
Expand Down Expand Up @@ -297,7 +298,7 @@ def test_path_params_delete(self, client: Codex) -> None:
@parametrize
def test_method_retrieve_project_id(self, client: Codex) -> None:
access_key = client.projects.access_keys.retrieve_project_id()
assert_matches_type(str, access_key, path=["response"])
assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -307,7 +308,7 @@ def test_raw_response_retrieve_project_id(self, client: Codex) -> None:
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
access_key = response.parse()
assert_matches_type(str, access_key, path=["response"])
assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -317,7 +318,7 @@ def test_streaming_response_retrieve_project_id(self, client: Codex) -> None:
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

access_key = response.parse()
assert_matches_type(str, access_key, path=["response"])
assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down Expand Up @@ -653,7 +654,7 @@ async def test_path_params_delete(self, async_client: AsyncCodex) -> None:
@parametrize
async def test_method_retrieve_project_id(self, async_client: AsyncCodex) -> None:
access_key = await async_client.projects.access_keys.retrieve_project_id()
assert_matches_type(str, access_key, path=["response"])
assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -663,7 +664,7 @@ async def test_raw_response_retrieve_project_id(self, async_client: AsyncCodex)
assert response.is_closed is True
assert response.http_request.headers.get("X-Stainless-Lang") == "python"
access_key = await response.parse()
assert_matches_type(str, access_key, path=["response"])
assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"])

@pytest.mark.skip()
@parametrize
Expand All @@ -673,7 +674,7 @@ async def test_streaming_response_retrieve_project_id(self, async_client: AsyncC
assert response.http_request.headers.get("X-Stainless-Lang") == "python"

access_key = await response.parse()
assert_matches_type(str, access_key, path=["response"])
assert_matches_type(AccessKeyRetrieveProjectIDResponse, access_key, path=["response"])

assert cast(Any, response.is_closed) is True

Expand Down
4 changes: 2 additions & 2 deletions tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -522,7 +522,7 @@ def test_base_url_env(self) -> None:
Codex(_strict_response_validation=True, environment="production")

client = Codex(base_url=None, _strict_response_validation=True, environment="production")
assert str(client.base_url).startswith("https://api-codex-o3gxj3oajfu.cleanlab.ai")
assert str(client.base_url).startswith("https://api-codex.cleanlab.ai")

@pytest.mark.parametrize(
"client",
Expand Down Expand Up @@ -1263,7 +1263,7 @@ def test_base_url_env(self) -> None:
AsyncCodex(_strict_response_validation=True, environment="production")

client = AsyncCodex(base_url=None, _strict_response_validation=True, environment="production")
assert str(client.base_url).startswith("https://api-codex-o3gxj3oajfu.cleanlab.ai")
assert str(client.base_url).startswith("https://api-codex.cleanlab.ai")

@pytest.mark.parametrize(
"client",
Expand Down
Loading