-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Excavator: Upgrade API Version (#106)
- Loading branch information
1 parent
2fce34a
commit 4d6439f
Showing
22 changed files
with
148 additions
and
31 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# FunctionRetrievedContext | ||
|
||
Context retrieved from running a function to include as additional context in the prompt to the Agent. | ||
|
||
|
||
## Properties | ||
| Name | Type | Required | Description | | ||
| ------------ | ------------- | ------------- | ------------- | | ||
**function_rid** | FunctionRid | Yes | | | ||
**function_version** | FunctionVersion | Yes | | | ||
**retrieved_prompt** | str | Yes | String content returned from a context retrieval function. | | ||
**type** | Literal["functionRetrievedContext"] | Yes | None | | ||
|
||
|
||
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
# FunctionRetrievedContextDict | ||
|
||
Context retrieved from running a function to include as additional context in the prompt to the Agent. | ||
|
||
|
||
## Properties | ||
| Name | Type | Required | Description | | ||
| ------------ | ------------- | ------------- | ------------- | | ||
**functionRid** | FunctionRid | Yes | | | ||
**functionVersion** | FunctionVersion | Yes | | | ||
**retrievedPrompt** | str | Yes | String content returned from a context retrieval function. | | ||
**type** | Literal["functionRetrievedContext"] | Yes | None | | ||
|
||
|
||
[[Back to Model list]](../../../../README.md#models-v2-link) [[Back to API list]](../../../../README.md#apis-v2-link) [[Back to README]](../../../../README.md) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
49 changes: 49 additions & 0 deletions
49
foundry/v2/aip_agents/models/_function_retrieved_context.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
# Copyright 2024 Palantir Technologies, Inc. | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
|
||
|
||
from __future__ import annotations | ||
|
||
from typing import Literal | ||
from typing import cast | ||
|
||
import pydantic | ||
|
||
from foundry.v2.aip_agents.models._function_retrieved_context_dict import ( | ||
FunctionRetrievedContextDict, | ||
) # NOQA | ||
from foundry.v2.functions.models._function_rid import FunctionRid | ||
from foundry.v2.functions.models._function_version import FunctionVersion | ||
|
||
|
||
class FunctionRetrievedContext(pydantic.BaseModel): | ||
"""Context retrieved from running a function to include as additional context in the prompt to the Agent.""" | ||
|
||
function_rid: FunctionRid = pydantic.Field(alias="functionRid") | ||
|
||
function_version: FunctionVersion = pydantic.Field(alias="functionVersion") | ||
|
||
retrieved_prompt: str = pydantic.Field(alias="retrievedPrompt") | ||
|
||
"""String content returned from a context retrieval function.""" | ||
|
||
type: Literal["functionRetrievedContext"] = "functionRetrievedContext" | ||
|
||
model_config = {"extra": "allow"} | ||
|
||
def to_dict(self) -> FunctionRetrievedContextDict: | ||
"""Return the dictionary representation of the model using the field aliases.""" | ||
return cast( | ||
FunctionRetrievedContextDict, self.model_dump(by_alias=True, exclude_unset=True) | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters