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
14 changes: 13 additions & 1 deletion .github/workflows/stlc-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,14 +76,26 @@ jobs:

- name: Sync production to staging (fast-forward)
if: steps.diff.outputs.behind == 'true'
env:
PUSH_TOKEN: ${{ secrets.PRODUCTION_REPO_TOKEN }}
run: |
# Refuse unless staging is an ancestor of production: otherwise the
# trunks have forked and a fast-forward would be unsafe.
if ! git merge-base --is-ancestor origin/main production/main; then
echo "::error title=Back-sync blocked::staging main is not an ancestor of production/main."
exit 1
fi
git push origin production/main:refs/heads/main
# Push as the automation identity (PRODUCTION_REPO_TOKEN), not GITHUB_TOKEN:
# staging main requires a pull request for humans and only the automation's
# repository role bypasses that rule. A token push (unlike GITHUB_TOKEN) also
# triggers seal-dispatch, so the config repo re-seals right away instead of
# at the next scheduled sync. Blank the persisted GITHUB_TOKEN header first.
if [ -n "${PUSH_TOKEN:-}" ]; then
git -c "http.https://github.com/.extraheader=" push \
"https://x-access-token:${PUSH_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" production/main:refs/heads/main
else
git push origin production/main:refs/heads/main
fi
echo "Fast-forwarded staging/main to production/main."

- name: Alert on failure
Expand Down
2 changes: 1 addition & 1 deletion .stats.yml
Original file line number Diff line number Diff line change
@@ -1 +1 @@
configured_endpoints: 32
configured_endpoints: 58
149 changes: 148 additions & 1 deletion api.md
Original file line number Diff line number Diff line change
Expand Up @@ -186,12 +186,13 @@ Methods:
Types:

```python
from openlayer.types.storage import PresignedURLCreateResponse
from openlayer.types.storage import PresignedURLCreateResponse, PresignedURLRetrieveResponse
```

Methods:

- <code title="post /storage/presigned-url">client.storage.presigned_url.<a href="./src/openlayer/resources/storage/presigned_url.py">create</a>(\*\*<a href="src/openlayer/types/storage/presigned_url_create_params.py">params</a>) -> <a href="./src/openlayer/types/storage/presigned_url_create_response.py">PresignedURLCreateResponse</a></code>
- <code title="get /storage/presigned-url">client.storage.presigned_url.<a href="./src/openlayer/resources/storage/presigned_url.py">retrieve</a>(\*\*<a href="src/openlayer/types/storage/presigned_url_retrieve_params.py">params</a>) -> <a href="./src/openlayer/types/storage/presigned_url_retrieve_response.py">PresignedURLRetrieveResponse</a></code>

# Tests

Expand All @@ -205,3 +206,149 @@ Methods:

- <code title="post /tests/{testId}/evaluate">client.tests.<a href="./src/openlayer/resources/tests.py">evaluate</a>(test_id, \*\*<a href="src/openlayer/types/test_evaluate_params.py">params</a>) -> <a href="./src/openlayer/types/test_evaluate_response.py">TestEvaluateResponse</a></code>
- <code title="get /tests/{testId}/results">client.tests.<a href="./src/openlayer/resources/tests.py">list_results</a>(test_id, \*\*<a href="src/openlayer/types/test_list_results_params.py">params</a>) -> <a href="./src/openlayer/types/test_list_results_response.py">TestListResultsResponse</a></code>

# BackgroundTasks

Types:

```python
from openlayer.types import BackgroundTaskRetrieveResponse
```

Methods:

- <code title="get /background-tasks/{taskId}">client.background_tasks.<a href="./src/openlayer/resources/background_tasks.py">retrieve</a>(task_id) -> <a href="./src/openlayer/types/background_task_retrieve_response.py">BackgroundTaskRetrieveResponse</a></code>

# Governance

## Frameworks

Types:

```python
from openlayer.types.governance import (
FrameworkCreateResponse,
FrameworkRetrieveResponse,
FrameworkUpdateResponse,
FrameworkListResponse,
FrameworkExportResponse,
FrameworkListProjectRuleStatsResponse,
FrameworkListProjectsResponse,
FrameworkListRulesResponse,
)
```

Methods:

- <code title="post /workspaces/{workspaceId}/frameworks">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">create</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/framework_create_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_create_response.py">FrameworkCreateResponse</a></code>
- <code title="get /frameworks/{frameworkId}">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">retrieve</a>(framework_id) -> <a href="./src/openlayer/types/governance/framework_retrieve_response.py">FrameworkRetrieveResponse</a></code>
- <code title="put /frameworks/{frameworkId}">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">update</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_update_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_update_response.py">FrameworkUpdateResponse</a></code>
- <code title="get /workspaces/{workspaceId}/frameworks">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/framework_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_response.py">FrameworkListResponse</a></code>
- <code title="post /frameworks/{frameworkId}/export">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">export</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_export_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_export_response.py">FrameworkExportResponse</a></code>
- <code title="get /frameworks/{frameworkId}/project-rule-stats">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list_project_rule_stats</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_list_project_rule_stats_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_project_rule_stats_response.py">FrameworkListProjectRuleStatsResponse</a></code>
- <code title="get /frameworks/{frameworkId}/projects">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list_projects</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_list_projects_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_projects_response.py">FrameworkListProjectsResponse</a></code>
- <code title="get /frameworks/{frameworkId}/rules">client.governance.frameworks.<a href="./src/openlayer/resources/governance/frameworks/frameworks.py">list_rules</a>(framework_id, \*\*<a href="src/openlayer/types/governance/framework_list_rules_params.py">params</a>) -> <a href="./src/openlayer/types/governance/framework_list_rules_response.py">FrameworkListRulesResponse</a></code>

### Documents

Types:

```python
from openlayer.types.governance.frameworks import DocumentRetrieveResponse, DocumentListResponse
```

Methods:

- <code title="get /frameworks/{frameworkId}/documents/{documentId}">client.governance.frameworks.documents.<a href="./src/openlayer/resources/governance/frameworks/documents.py">retrieve</a>(document_id, \*, framework_id) -> <a href="./src/openlayer/types/governance/frameworks/document_retrieve_response.py">DocumentRetrieveResponse</a></code>
- <code title="get /frameworks/{frameworkId}/documents">client.governance.frameworks.documents.<a href="./src/openlayer/resources/governance/frameworks/documents.py">list</a>(framework_id, \*\*<a href="src/openlayer/types/governance/frameworks/document_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/frameworks/document_list_response.py">DocumentListResponse</a></code>

### Sections

Types:

```python
from openlayer.types.governance.frameworks import SectionListRulesResponse
```

Methods:

- <code title="get /frameworks/{frameworkId}/sections/{sectionId}/rules">client.governance.frameworks.sections.<a href="./src/openlayer/resources/governance/frameworks/sections.py">list_rules</a>(section_id, \*, framework_id, \*\*<a href="src/openlayer/types/governance/frameworks/section_list_rules_params.py">params</a>) -> <a href="./src/openlayer/types/governance/frameworks/section_list_rules_response.py">SectionListRulesResponse</a></code>

### Subsections

Types:

```python
from openlayer.types.governance.frameworks import SubsectionListRulesResponse
```

Methods:

- <code title="get /frameworks/{frameworkId}/subsections/{subsectionId}/rules">client.governance.frameworks.subsections.<a href="./src/openlayer/resources/governance/frameworks/subsections.py">list_rules</a>(subsection_id, \*, framework_id, \*\*<a href="src/openlayer/types/governance/frameworks/subsection_list_rules_params.py">params</a>) -> <a href="./src/openlayer/types/governance/frameworks/subsection_list_rules_response.py">SubsectionListRulesResponse</a></code>

## Rules

Types:

```python
from openlayer.types.governance import (
RuleCreateResponse,
RuleRetrieveResponse,
RuleUpdateResponse,
RuleListResponse,
)
```

Methods:

- <code title="post /workspaces/{workspaceId}/rules">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">create</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_create_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_create_response.py">RuleCreateResponse</a></code>
- <code title="get /rules/{ruleId}">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">retrieve</a>(rule_id) -> <a href="./src/openlayer/types/governance/rule_retrieve_response.py">RuleRetrieveResponse</a></code>
- <code title="put /rules/{ruleId}">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">update</a>(rule_id, \*\*<a href="src/openlayer/types/governance/rule_update_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_update_response.py">RuleUpdateResponse</a></code>
- <code title="get /workspaces/{workspaceId}/rules">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_list_response.py">RuleListResponse</a></code>
- <code title="delete /rules/{ruleId}">client.governance.rules.<a href="./src/openlayer/resources/governance/rules.py">delete</a>(rule_id) -> None</code>

## RuleResults

Types:

```python
from openlayer.types.governance import (
RuleResultRetrieveResponse,
RuleResultUpdateResponse,
RuleResultListResponse,
RuleResultCreateEvidenceResponse,
RuleResultListEvidenceResponse,
)
```

Methods:

- <code title="get /rule-results/{ruleResultId}">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">retrieve</a>(rule_result_id) -> <a href="./src/openlayer/types/governance/rule_result_retrieve_response.py">RuleResultRetrieveResponse</a></code>
- <code title="patch /rule-results/{ruleResultId}">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">update</a>(rule_result_id, \*\*<a href="src/openlayer/types/governance/rule_result_update_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_update_response.py">RuleResultUpdateResponse</a></code>
- <code title="get /workspaces/{workspaceId}/rule-results">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_result_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_list_response.py">RuleResultListResponse</a></code>
- <code title="post /rule-results/{ruleResultId}/evidence">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">create_evidence</a>(rule_result_id, \*\*<a href="src/openlayer/types/governance/rule_result_create_evidence_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_create_evidence_response.py">RuleResultCreateEvidenceResponse</a></code>
- <code title="get /rule-results/{ruleResultId}/evidence">client.governance.rule_results.<a href="./src/openlayer/resources/governance/rule_results.py">list_evidence</a>(rule_result_id, \*\*<a href="src/openlayer/types/governance/rule_result_list_evidence_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_result_list_evidence_response.py">RuleResultListEvidenceResponse</a></code>

## RuleStats

Types:

```python
from openlayer.types.governance import RuleStatRetrieveResponse
```

Methods:

- <code title="get /workspaces/{workspaceId}/rule-stats">client.governance.rule_stats.<a href="./src/openlayer/resources/governance/rule_stats.py">retrieve</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_stat_retrieve_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_stat_retrieve_response.py">RuleStatRetrieveResponse</a></code>

## RuleTags

Types:

```python
from openlayer.types.governance import RuleTagListResponse
```

Methods:

- <code title="get /workspaces/{workspaceId}/rule-tags">client.governance.rule_tags.<a href="./src/openlayer/resources/governance/rule_tags.py">list</a>(workspace_id, \*\*<a href="src/openlayer/types/governance/rule_tag_list_params.py">params</a>) -> <a href="./src/openlayer/types/governance/rule_tag_list_response.py">RuleTagListResponse</a></code>
2 changes: 1 addition & 1 deletion scripts/mock

Large diffs are not rendered by default.

85 changes: 84 additions & 1 deletion src/openlayer/_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,22 @@
)

if TYPE_CHECKING:
from .resources import tests, commits, storage, projects, workspaces, inference_pipelines
from .resources import (
tests,
commits,
storage,
projects,
governance,
workspaces,
background_tasks,
inference_pipelines,
)
from .resources.tests import TestsResource, AsyncTestsResource
from .resources.commits.commits import CommitsResource, AsyncCommitsResource
from .resources.storage.storage import StorageResource, AsyncStorageResource
from .resources.background_tasks import BackgroundTasksResource, AsyncBackgroundTasksResource
from .resources.projects.projects import ProjectsResource, AsyncProjectsResource
from .resources.governance.governance import GovernanceResource, AsyncGovernanceResource
from .resources.workspaces.workspaces import WorkspacesResource, AsyncWorkspacesResource
from .resources.inference_pipelines.inference_pipelines import (
InferencePipelinesResource,
Expand Down Expand Up @@ -155,6 +166,18 @@ def tests(self) -> TestsResource:

return TestsResource(self)

@cached_property
def background_tasks(self) -> BackgroundTasksResource:
from .resources.background_tasks import BackgroundTasksResource

return BackgroundTasksResource(self)

@cached_property
def governance(self) -> GovernanceResource:
from .resources.governance import GovernanceResource

return GovernanceResource(self)

@cached_property
def with_raw_response(self) -> OpenlayerWithRawResponse:
return OpenlayerWithRawResponse(self)
Expand Down Expand Up @@ -375,6 +398,18 @@ def tests(self) -> AsyncTestsResource:

return AsyncTestsResource(self)

@cached_property
def background_tasks(self) -> AsyncBackgroundTasksResource:
from .resources.background_tasks import AsyncBackgroundTasksResource

return AsyncBackgroundTasksResource(self)

@cached_property
def governance(self) -> AsyncGovernanceResource:
from .resources.governance import AsyncGovernanceResource

return AsyncGovernanceResource(self)

@cached_property
def with_raw_response(self) -> AsyncOpenlayerWithRawResponse:
return AsyncOpenlayerWithRawResponse(self)
Expand Down Expand Up @@ -541,6 +576,18 @@ def tests(self) -> tests.TestsResourceWithRawResponse:

return TestsResourceWithRawResponse(self._client.tests)

@cached_property
def background_tasks(self) -> background_tasks.BackgroundTasksResourceWithRawResponse:
from .resources.background_tasks import BackgroundTasksResourceWithRawResponse

return BackgroundTasksResourceWithRawResponse(self._client.background_tasks)

@cached_property
def governance(self) -> governance.GovernanceResourceWithRawResponse:
from .resources.governance import GovernanceResourceWithRawResponse

return GovernanceResourceWithRawResponse(self._client.governance)


class AsyncOpenlayerWithRawResponse:
_client: AsyncOpenlayer
Expand Down Expand Up @@ -584,6 +631,18 @@ def tests(self) -> tests.AsyncTestsResourceWithRawResponse:

return AsyncTestsResourceWithRawResponse(self._client.tests)

@cached_property
def background_tasks(self) -> background_tasks.AsyncBackgroundTasksResourceWithRawResponse:
from .resources.background_tasks import AsyncBackgroundTasksResourceWithRawResponse

return AsyncBackgroundTasksResourceWithRawResponse(self._client.background_tasks)

@cached_property
def governance(self) -> governance.AsyncGovernanceResourceWithRawResponse:
from .resources.governance import AsyncGovernanceResourceWithRawResponse

return AsyncGovernanceResourceWithRawResponse(self._client.governance)


class OpenlayerWithStreamedResponse:
_client: Openlayer
Expand Down Expand Up @@ -627,6 +686,18 @@ def tests(self) -> tests.TestsResourceWithStreamingResponse:

return TestsResourceWithStreamingResponse(self._client.tests)

@cached_property
def background_tasks(self) -> background_tasks.BackgroundTasksResourceWithStreamingResponse:
from .resources.background_tasks import BackgroundTasksResourceWithStreamingResponse

return BackgroundTasksResourceWithStreamingResponse(self._client.background_tasks)

@cached_property
def governance(self) -> governance.GovernanceResourceWithStreamingResponse:
from .resources.governance import GovernanceResourceWithStreamingResponse

return GovernanceResourceWithStreamingResponse(self._client.governance)


class AsyncOpenlayerWithStreamedResponse:
_client: AsyncOpenlayer
Expand Down Expand Up @@ -670,6 +741,18 @@ def tests(self) -> tests.AsyncTestsResourceWithStreamingResponse:

return AsyncTestsResourceWithStreamingResponse(self._client.tests)

@cached_property
def background_tasks(self) -> background_tasks.AsyncBackgroundTasksResourceWithStreamingResponse:
from .resources.background_tasks import AsyncBackgroundTasksResourceWithStreamingResponse

return AsyncBackgroundTasksResourceWithStreamingResponse(self._client.background_tasks)

@cached_property
def governance(self) -> governance.AsyncGovernanceResourceWithStreamingResponse:
from .resources.governance import AsyncGovernanceResourceWithStreamingResponse

return AsyncGovernanceResourceWithStreamingResponse(self._client.governance)


Client = Openlayer

Expand Down
Loading
Loading