Skip to content
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

Feature/native functions #867

Merged
merged 90 commits into from
Jul 10, 2024
Merged

Feature/native functions #867

merged 90 commits into from
Jul 10, 2024

Conversation

collindutter
Copy link
Member

@collindutter collindutter commented Jun 14, 2024


📚 Documentation preview 📚: https://griptape--867.org.readthedocs.build//867/

Closes #91

@collindutter collindutter changed the base branch from dev to refactor/prompt-stack-elements2 June 14, 2024 22:49
@collindutter collindutter force-pushed the feature/native-functions branch from abc66b1 to 1c8648b Compare June 14, 2024 22:50
@collindutter collindutter force-pushed the feature/native-functions branch from 1c8648b to ab214a9 Compare June 14, 2024 23:01
@collindutter collindutter force-pushed the refactor/prompt-stack-elements2 branch 3 times, most recently from b110a4f to f756096 Compare June 14, 2024 23:28
@collindutter collindutter force-pushed the feature/native-functions branch from ab214a9 to 4dd3e4b Compare June 14, 2024 23:30
@collindutter collindutter force-pushed the refactor/prompt-stack-elements2 branch from 19337e1 to 7abc1cc Compare June 17, 2024 19:04
@collindutter collindutter force-pushed the feature/native-functions branch from 4dd3e4b to 6d66095 Compare June 17, 2024 19:04
@collindutter collindutter force-pushed the refactor/prompt-stack-elements2 branch from 7abc1cc to ab2a2dd Compare June 18, 2024 17:27
@collindutter collindutter force-pushed the feature/native-functions branch from db726c7 to a78c8f2 Compare June 18, 2024 17:30
@collindutter collindutter force-pushed the refactor/prompt-stack-elements2 branch from ffd1dd9 to 04f2ed9 Compare June 18, 2024 20:58
@collindutter collindutter force-pushed the feature/native-functions branch from 06a5190 to fc53df6 Compare June 18, 2024 23:07
@collindutter collindutter force-pushed the refactor/prompt-stack-elements2 branch from 04f2ed9 to e6e63b9 Compare June 19, 2024 19:45
@collindutter collindutter force-pushed the feature/native-functions branch 2 times, most recently from 6bb026e to 09bcd0c Compare June 19, 2024 20:54
@collindutter collindutter force-pushed the refactor/prompt-stack-elements2 branch from 1767a83 to a53762d Compare June 19, 2024 21:29
@collindutter collindutter force-pushed the feature/native-functions branch 2 times, most recently from c0540fb to d8c42ef Compare June 19, 2024 22:39
@collindutter collindutter marked this pull request as ready for review July 9, 2024 00:07
dylanholmes
dylanholmes previously approved these changes Jul 9, 2024
Copy link
Contributor

@dylanholmes dylanholmes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚒️ ❗

CHANGELOG.md Outdated
@@ -55,6 +55,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Support for `PromptTask`s to take `TextArtifact`s, `ImageArtifact`s, and `ListArtifact`s as input.
- Parameters `sort_key` and `sort_key_value` on `AmazonDynamoDbConversationMemoryDriver` for tables with sort keys.
- `Reference` for supporting artifact citations in loaders and RAG engine modules.
- Native function calling support to `OpenAiChatPromptDriver`, `AzureOpenAiChatPromptDriver`, `AnthropicPromptDriver`, `AmazonBedrockPromptDriver`, `GooglePromptDriver`, and `CoherePromptDriver`.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🎉

@collindutter collindutter force-pushed the feature/native-functions branch from a288e2a to ba8e2f6 Compare July 9, 2024 16:07
@collindutter collindutter requested a review from dylanholmes July 9, 2024 17:24
dylanholmes
dylanholmes previously approved these changes Jul 9, 2024
Copy link
Member

@vasinov vasinov left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! What a gnarly update 🤪

Comment on lines 17 to 24
Attributes:
tag: The tag (unique identifier) of the action.
name: The name (Tool name) of the action.
path: The path (Tool activity name) of the action.
input: The input (Tool params) of the action.
tool: The matched Tool of the action.
output: The output (Tool result) of the action.
"""
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This docstring should be in Action.



@define(kw_only=True)
class Action(SerializableMixin):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we add some prefix to this? I'm worried that we might have some other "action" in the future, unrelated to LLM actions, which will be confusing naming-wise.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ToolAction?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Refactored into BaseAction and ToolAction

def __str__(self) -> str:
return json.dumps(self.to_dict())

def to_dict(self) -> dict:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why did you need to override this? Can't we just set tool and output to non-serializable?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep, updated.

@collindutter collindutter force-pushed the feature/native-functions branch from cb45f54 to a06442c Compare July 10, 2024 20:21
@collindutter collindutter force-pushed the feature/native-functions branch from a06442c to 9c44a62 Compare July 10, 2024 20:30
@collindutter collindutter force-pushed the feature/native-functions branch from a24a39a to 3d4fd4a Compare July 10, 2024 21:02
@collindutter collindutter merged commit 8fa35a5 into dev Jul 10, 2024
13 checks passed
@collindutter collindutter deleted the feature/native-functions branch July 10, 2024 22:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tools vs Functions
3 participants