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
22 changes: 22 additions & 0 deletions examples/examples/simple/core/get-run-id.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import gentrace
import os
from dotenv import load_dotenv

load_dotenv()


def main():
gentrace.init(
api_key=os.getenv("GENTRACE_API_KEY"),
host="http://localhost:3000/api",
)

# example runID
run_id = "5615b021-03cd-4cd9-9bc8-6a2f7bf4240e"
run_data = gentrace.get_run(run_id)

print(run_data)
print(run_data["stepRuns"][0]["inputs"])
print(run_data["stepRuns"][0]["outputs"])

main()
119 changes: 65 additions & 54 deletions examples/poetry.lock

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ openai = "1.13.3"
pinecone-client = "^2.2.1"
python = "^3.8.1"
python-dotenv = "^1.0.0"
gentrace-py = {path = "../package/dist/gentrace_py-0.28.2.tar.gz", develop = true}
gentrace-py = {path = "../package/dist/gentrace_py-0.28.3.tar.gz", develop = true}

[tool.poetry.group.lint.dependencies]
black = "^23.3.0"
Expand Down
9 changes: 9 additions & 0 deletions package/.openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,11 @@ docs/models/PipelineV2.md
docs/models/ResolvedStepRun.md
docs/models/RunRequest.md
docs/models/RunResponse.md
docs/models/RunV2.md
docs/models/SearchableStringInput.md
docs/models/SearchableUnixSecondsInput.md
docs/models/StepRun.md
docs/models/StringType.md
docs/models/TestCase.md
docs/models/TestCaseV2.md
docs/models/TestEvaluation.md
Expand All @@ -32,6 +34,7 @@ docs/models/TestRun.md
docs/models/UnixSeconds.md
docs/models/UpdateFeedbackV2.md
docs/models/UpdateTestCase.md
docs/models/UrlType.md
gentrace/__init__.py
gentrace/api_client.py
gentrace/apis/__init__.py
Expand Down Expand Up @@ -77,12 +80,16 @@ gentrace/model/run_request.py
gentrace/model/run_request.pyi
gentrace/model/run_response.py
gentrace/model/run_response.pyi
gentrace/model/run_v2.py
gentrace/model/run_v2.pyi
gentrace/model/searchable_string_input.py
gentrace/model/searchable_string_input.pyi
gentrace/model/searchable_unix_seconds_input.py
gentrace/model/searchable_unix_seconds_input.pyi
gentrace/model/step_run.py
gentrace/model/step_run.pyi
gentrace/model/string_type.py
gentrace/model/string_type.pyi
gentrace/model/test_case.py
gentrace/model/test_case.pyi
gentrace/model/test_case_v2.py
Expand All @@ -103,6 +110,8 @@ gentrace/model/update_feedback_v2.py
gentrace/model/update_feedback_v2.pyi
gentrace/model/update_test_case.py
gentrace/model/update_test_case.pyi
gentrace/model/url_type.py
gentrace/model/url_type.pyi
gentrace/models/__init__.py
gentrace/rest.py
gentrace/schemas.py
1 change: 1 addition & 0 deletions package/.python-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.11.0
12 changes: 3 additions & 9 deletions package/docs/apis/tags/V1Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -664,9 +664,7 @@ with gentrace.ApiClient(configuration) as api_client:
slug="slug_example",
previous_run_id="previous_run_id_example",
metadata=dict(
"key": MetadataValueObject(
type="type_example",
),
"key": MetadataValueObject(),
),
step_runs=[
StepRun(
Expand Down Expand Up @@ -1582,9 +1580,7 @@ with gentrace.ApiClient(configuration) as api_client:
commit="commit_example",
name="name_example",
metadata=dict(
"key": MetadataValueObject(
type="type_example",
),
"key": MetadataValueObject(),
),
test_runs=[
dict(
Expand Down Expand Up @@ -1809,9 +1805,7 @@ with gentrace.ApiClient(configuration) as api_client:
commit="commit_example",
name="name_example",
metadata=dict(
"key": MetadataValueObject(
type="type_example",
),
"key": MetadataValueObject(),
),
test_runs=[
dict(
Expand Down
112 changes: 112 additions & 0 deletions package/docs/apis/tags/V2Api.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Method | HTTP request | Description
[**v2_folders_get**](#v2_folders_get) | **get** /v2/folders | Get folders
[**v2_folders_id_get**](#v2_folders_id_get) | **get** /v2/folders/{id} | Get a folder
[**v2_pipelines_get**](#v2_pipelines_get) | **get** /v2/pipelines | Get pipelines
[**v2_runs_id_get**](#v2_runs_id_get) | **get** /v2/runs/{id} | Get a run
[**v2_test_cases_get**](#v2_test_cases_get) | **get** /v2/test-cases | Get test cases
[**v2_test_cases_id_get**](#v2_test_cases_id_get) | **get** /v2/test-cases/{id} | Get a test case
[**v2_test_results_get**](#v2_test_results_get) | **get** /v2/test-results | Get test results
Expand Down Expand Up @@ -949,6 +950,117 @@ Class Name | Input Type | Accessed Type | Description | Notes

[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)

# **v2_runs_id_get**
<a name="v2_runs_id_get"></a>
> RunV2 v2_runs_id_get(id)

Get a run

### Example

* Bearer Authentication (bearerAuth):
```python
import gentrace
from gentrace.apis.tags import v2_api
from gentrace.model.run_v2 import RunV2
from pprint import pprint
# Defining the host is optional and defaults to https://gentrace.ai/api
# See configuration.py for a list of all supported configuration parameters.
configuration = gentrace.Configuration(
host = "https://gentrace.ai/api"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization: bearerAuth
configuration = gentrace.Configuration(
access_token = 'YOUR_BEARER_TOKEN'
)
# Enter a context with an instance of the API client
with gentrace.ApiClient(configuration) as api_client:
# Create an instance of the API class
api_instance = v2_api.V2Api(api_client)

# example passing only required values which don't have defaults set
path_params = {
'id': "id_example",
}
try:
# Get a run
api_response = api_instance.v2_runs_id_get(
path_params=path_params,
)
pprint(api_response)
except gentrace.ApiException as e:
print("Exception when calling V2Api->v2_runs_id_get: %s\n" % e)
```
### Parameters

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
path_params | RequestPathParams | |
accept_content_types | typing.Tuple[str] | default is ('application/json', 'application/json; charset&#x3D;utf-8', ) | Tells the server the content type(s) that are accepted by the client
stream | bool | default is False | if True then the response.content will be streamed and loaded from a file like object. When downloading a file, set this to True to force the code to deserialize the content to a FileSchema file
timeout | typing.Optional[typing.Union[int, typing.Tuple]] | default is None | the timeout used by the rest client
skip_deserialization | bool | default is False | when True, headers and body will be unset and an instance of api_client.ApiResponseWithoutDeserialization will be returned

### path_params
#### RequestPathParams

Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
id | IdSchema | |

# IdSchema

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
str, uuid.UUID, | str, | | value must be a uuid

### Return Types, Responses

Code | Class | Description
------------- | ------------- | -------------
n/a | api_client.ApiResponseWithoutDeserialization | When skip_deserialization is True this response is returned
200 | [ApiResponseFor200](#v2_runs_id_get.ApiResponseFor200) | Run retrieved successfully
404 | [ApiResponseFor404](#v2_runs_id_get.ApiResponseFor404) | Run not found

#### v2_runs_id_get.ApiResponseFor200
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | typing.Union[SchemaFor200ResponseBodyApplicationJson, SchemaFor200ResponseBodyApplicationJsonCharsetutf8, ] | |
headers | Unset | headers were not defined |

# SchemaFor200ResponseBodyApplicationJson
Type | Description | Notes
------------- | ------------- | -------------
[**RunV2**](../../models/RunV2.md) | |


# SchemaFor200ResponseBodyApplicationJsonCharsetutf8
Type | Description | Notes
------------- | ------------- | -------------
[**RunV2**](../../models/RunV2.md) | |


#### v2_runs_id_get.ApiResponseFor404
Name | Type | Description | Notes
------------- | ------------- | ------------- | -------------
response | urllib3.HTTPResponse | Raw response |
body | Unset | body was not defined |
headers | Unset | headers were not defined |

### Authorization

[bearerAuth](../../../README.md#bearerAuth)

[[Back to top]](#__pageTop) [[Back to API list]](../../../README.md#documentation-for-api-endpoints) [[Back to Model list]](../../../README.md#documentation-for-models) [[Back to README]](../../../README.md)

# **v2_test_cases_get**
<a name="v2_test_cases_get"></a>
> {str: (bool, date, datetime, dict, float, int, list, str, none_type)} v2_test_cases_get()
Expand Down
9 changes: 8 additions & 1 deletion package/docs/models/MetadataValueObject.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,14 @@ dict, frozendict.frozendict, | frozendict.frozendict, | |
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**type** | str, | str, | |
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, uuid.UUID, int, float, decimal.Decimal, bool, None, list, tuple, bytes, io.FileIO, io.BufferedReader, | frozendict.frozendict, str, decimal.Decimal, BoolClass, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional]
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional]

### Composed Schemas (allOf/anyOf/oneOf/not)
#### oneOf
Class Name | Input Type | Accessed Type | Description | Notes
------------- | ------------- | ------------- | ------------- | -------------
[UrlType](UrlType.md) | [**UrlType**](UrlType.md) | [**UrlType**](UrlType.md) | |
[StringType](StringType.md) | [**StringType**](StringType.md) | [**StringType**](StringType.md) | |

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

92 changes: 92 additions & 0 deletions package/docs/models/RunV2.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
# gentrace.model.run_v2.RunV2

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, frozendict.frozendict, | frozendict.frozendict, | |

### Dictionary Keys
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**[stepRuns](#stepRuns)** | list, tuple, | tuple, | |
**id** | str, uuid.UUID, | str, | The ID of the run | value must be a uuid
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional]

# stepRuns

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
list, tuple, | tuple, | |

### Tuple Items
Class Name | Input Type | Accessed Type | Description | Notes
------------- | ------------- | ------------- | ------------- | -------------
[items](#items) | dict, frozendict.frozendict, | frozendict.frozendict, | |

# items

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, frozendict.frozendict, | frozendict.frozendict, | |

### Dictionary Keys
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**[outputs](#outputs)** | dict, frozendict.frozendict, | frozendict.frozendict, | The outputs of the run |
**invocation** | str, | str, | The name of the method being invoked |
**cost** | decimal.Decimal, int, float, | decimal.Decimal, | The cost of the run in USD |
**[modelParams](#modelParams)** | dict, frozendict.frozendict, | frozendict.frozendict, | The parameters used by the model |
**[inputs](#inputs)** | dict, frozendict.frozendict, | frozendict.frozendict, | The inputs of the run |
**stepId** | str, uuid.UUID, | str, | The ID of the step | value must be a uuid
**startTime** | decimal.Decimal, int, float, | decimal.Decimal, | Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object. | value must be a 32 bit float
**endTime** | decimal.Decimal, int, float, | decimal.Decimal, | Timestamp in seconds since the UNIX epoch. Can be transformed into a Date object. | value must be a 32 bit float
**providerName** | str, | str, | The name of the provider |
**stepRunId** | str, uuid.UUID, | str, | The ID of the step run | value must be a uuid
**elapsedTime** | decimal.Decimal, int, | decimal.Decimal, | The milliseconds to complete the run |
**order** | decimal.Decimal, int, | decimal.Decimal, | The order of the step run. The last step has the highest \&quot;order\&quot; number. |
**[metadata](#metadata)** | dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | | [optional]
**any_string_name** | dict, frozendict.frozendict, str, date, datetime, int, float, bool, decimal.Decimal, None, list, tuple, bytes, io.FileIO, io.BufferedReader | frozendict.frozendict, str, BoolClass, decimal.Decimal, NoneClass, tuple, bytes, FileIO | any string name can be used but the value must be the correct type | [optional]

# modelParams

The parameters used by the model

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, frozendict.frozendict, | frozendict.frozendict, | The parameters used by the model |

# inputs

The inputs of the run

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, frozendict.frozendict, | frozendict.frozendict, | The inputs of the run |

# outputs

The outputs of the run

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, frozendict.frozendict, | frozendict.frozendict, | The outputs of the run |

# metadata

## Model Type Info
Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | -------------
dict, frozendict.frozendict, None, | frozendict.frozendict, NoneClass, | |

### Dictionary Keys
Key | Input Type | Accessed Type | Description | Notes
------------ | ------------- | ------------- | ------------- | -------------
**any_string_name** | [**MetadataValueObject**](MetadataValueObject.md) | [**MetadataValueObject**](MetadataValueObject.md) | any string name can be used but the value must be the correct type | [optional]

[[Back to Model list]](../../README.md#documentation-for-models) [[Back to API list]](../../README.md#documentation-for-api-endpoints) [[Back to README]](../../README.md)

4 changes: 2 additions & 2 deletions package/gentrace/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

These API routes are designed to ingest events from clients. # noqa: E501

The version of the OpenAPI document: 0.23.0
The version of the OpenAPI document: 0.24.0
Generated by: https://openapi-generator.tech
"""

Expand All @@ -31,7 +31,7 @@

from gentrace.providers.evaluation import *
from gentrace.providers.pipeline import Pipeline
from gentrace.providers.pipeline_run import PipelineRun, flush
from gentrace.providers.pipeline_run import PipelineRun, flush, get_run
from gentrace.providers.step_run import StepRun
from gentrace.providers.utils import to_date_string
from gentrace.providers.files import *
Expand Down
Loading