Skip to content

Commit

Permalink
Merge branch 'dev' into feature/json-extraction
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed Oct 3, 2024
2 parents e15ba3f + e4133c3 commit 89a800a
Show file tree
Hide file tree
Showing 301 changed files with 3,856 additions and 2,333 deletions.
3 changes: 2 additions & 1 deletion .github/actions/init-bare-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ runs:
- name: Checkout actions
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- id: setup-python
name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
3 changes: 2 additions & 1 deletion .github/actions/init-environment/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ runs:
- name: Checkout actions
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
- id: setup-python
name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
Expand Down
24 changes: 24 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: 2
updates:
- package-ecosystem: "pip"
directory: "/"
schedule:
interval: "weekly"
groups:
dependencies:
dependency-type: "production"
update-types:
- "minor"
- "patch"
group-dependencies:
dependency-type: "development"
update-types:
- "minor"
- "patch"
allow:
- dependency-type: production
- dependency-type: development
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
10 changes: 5 additions & 5 deletions .github/workflows/code-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: ["3.12"]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run formatter
Expand All @@ -32,7 +32,7 @@ jobs:
python-version: [ "3.12" ]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run type checker
Expand All @@ -45,7 +45,7 @@ jobs:
python-version: [ "3.12" ]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run linter
Expand All @@ -58,7 +58,7 @@ jobs:
python-version: ["3.12"]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run unit tests
Expand All @@ -78,7 +78,7 @@ jobs:
python-version: [ "3.12" ]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run linter
Expand Down
6 changes: 5 additions & 1 deletion .github/workflows/docs-integration-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ jobs:
AZURE_OPENAI_API_KEY_2: ${{ secrets.INTEG_AZURE_OPENAI_API_KEY_2 }}
AZURE_OPENAI_ENDPOINT_3: ${{ secrets.INTEG_AZURE_OPENAI_ENDPOINT_3 }}
AZURE_OPENAI_API_KEY_3: ${{ secrets.INTEG_AZURE_OPENAI_API_KEY_3 }}
AZURE_OPENAI_ENDPOINT_4: ${{ secrets.INTEG_AZURE_OPENAI_ENDPOINT_4 }}
AZURE_OPENAI_API_KEY_4: ${{ secrets.INTEG_AZURE_OPENAI_API_KEY_4 }}
AZURE_OPENAI_35_TURBO_16K_DEPLOYMENT_ID: ${{ secrets.INTEG_OPENAI_35_TURBO_16K_DEPLOYMENT_ID }}
AZURE_OPENAI_35_TURBO_DEPLOYMENT_ID: ${{ secrets.INTEG_OPENAI_35_TURBO_DEPLOYMENT_ID }}
AZURE_OPENAI_DAVINCI_DEPLOYMENT_ID: ${{ secrets.INTEG_OPENAI_DAVINCI_DEPLOYMENT_ID }}
Expand Down Expand Up @@ -121,6 +123,8 @@ jobs:
QDRANT_CLUSTER_API_KEY: ${{ secrets.INTEG_QDRANT_CLUSTER_API_KEY }}
ASTRA_DB_API_ENDPOINT: ${{ secrets.INTEG_ASTRA_DB_API_ENDPOINT }}
ASTRA_DB_APPLICATION_TOKEN: ${{ secrets.INTEG_ASTRA_DB_APPLICATION_TOKEN }}
TAVILY_API_KEY: ${{ secrets.INTEG_TAVILY_API_KEY }}
EXA_API_KEY: ${{ secrets.INTEG_EXA_API_KEY }}
services:
postgres:
image: ankane/pgvector:v0.5.0
Expand All @@ -137,7 +141,7 @@ jobs:
--health-retries 5
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run integration tests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/unit-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run unit tests
Expand All @@ -32,7 +32,7 @@ jobs:
python-version: ["3.9"]
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-bare-environment
- name: Run unit tests
Expand All @@ -48,7 +48,7 @@ jobs:
shell: bash
steps:
- name: Checkout actions
uses: actions/checkout@v3
uses: actions/checkout@v4
- name: Init environment
uses: ./.github/actions/init-environment
- name: Run unit tests
Expand Down
107 changes: 102 additions & 5 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,39 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased
### Added
- `BaseConversationMemory.prompt_driver` for use with autopruning.
- Generic type support to `ListArtifact`.
- Iteration support to `ListArtifact`.

## Added
- `Workflow.input_tasks` and `Workflow.output_tasks` to access the input and output tasks of a Workflow.
- Ability to pass nested list of `Tasks` to `Structure.tasks` allowing for more complex declarative Structure definitions.
- `TavilyWebSearchDriver` to integrate Tavily's web search capabilities.
- `ExaWebSearchDriver` to integrate Exa's web search capabilities.
- `Workflow.outputs` to access the outputs of a Workflow.

### Changed
- **BREAKING**: Renamed parameters on several classes to `client`:
- `bedrock_client` on `AmazonBedrockCohereEmbeddingDriver`.
- `bedrock_client` on `AmazonBedrockCohereEmbeddingDriver`.
- `bedrock_client` on `AmazonBedrockTitanEmbeddingDriver`.
- `bedrock_client` on `AmazonBedrockImageGenerationDriver`.
- `bedrock_client` on `AmazonBedrockImageQueryDriver`.
- `bedrock_client` on `AmazonBedrockPromptDriver`.
- `sagemaker_client` on `AmazonSageMakerJumpstartEmbeddingDriver`.
- `sagemaker_client` on `AmazonSageMakerJumpstartPromptDriver`.
- `sqs_client` on `AmazonSqsEventListenerDriver`.
- `iotdata_client` on `AwsIotCoreEventListenerDriver`.
- `s3_client` on `AmazonS3FileManagerDriver`.
- `s3_client` on `AwsS3Tool`.
- `iam_client` on `AwsIamTool`.
- `pusher_client` on `PusherEventListenerDriver`.
- `mq` on `MarqoVectorStoreDriver`.
- `model_client` on `GooglePromptDriver`.
- `model_client` on `GoogleTokenizer`.
- **BREAKING**: Renamed parameter `pipe` on `HuggingFacePipelinePromptDriver` to `pipeline`.
- Several places where API clients are initialized are now lazy loaded.
- `Structure.output`'s type is now `BaseArtifact` and raises an exception if the output is `None`.
- **BREAKING**: Update `pypdf` dependency to `^5.0.1`.
- **BREAKING**: Update `redis` dependency to `^5.1.0`.
- `MarkdownifyWebScraperDriver.DEFAULT_EXCLUDE_TAGS` now includes media/blob-like HTML tags
- **BREAKING**: Split `BaseExtractionEngine.extract` into `extract_text` and `extract_artifacts` for consistency with `BaseSummaryEngine`.
- **BREAKING**: `BaseExtractionEngine` no longer catches exceptions and returns `ErrorArtifact`s.
- **BREAKING**: `JsonExtractionEngine.template_schema` is now required.
Expand All @@ -19,7 +46,77 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- `CsvExtractionEngine.extract_artifacts` now returns a `ListArtifact[CsvRowArtifact]`.

### Fixed
- Parsing streaming response with some OpenAi compatible services.
- Anthropic native Tool calling

## [0.32.0] - 2024-09-17

### Added
- `BaseArtifact.to_bytes()` method to convert an Artifact's value to bytes.
- `BlobArtifact.base64` property for converting a `BlobArtifact`'s value to a base64 string.
- `CsvLoader`/`SqlLoader`/`DataframeLoader` `formatter_fn` field for customizing how SQL results are formatted into `TextArtifact`s.
- `AzureOpenAiTextToSpeechDriver`.
- `JsonSchemaRule` for instructing the LLM to output a JSON object that conforms to a schema.
- Ability to use Event Listeners as Context Managers for temporarily setting the Event Bus listeners.
- Ability to use Drivers Configs as Context Managers for temporarily setting the default Drivers.
- Generic type support to `ListArtifact`.
- Iteration support to `ListArtifact`.


### Changed
- **BREAKING**: Removed `CsvRowArtifact`. Use `TextArtifact` instead.
- **BREAKING**: Removed `MediaArtifact`, use `ImageArtifact` or `AudioArtifact` instead.
- **BREAKING**: `CsvLoader`, `DataframeLoader`, and `SqlLoader` now return `list[TextArtifact]`.
- **BREAKING**: Removed `ImageArtifact.media_type`.
- **BREAKING**: Removed `AudioArtifact.media_type`.
- **BREAKING**: Removed `BlobArtifact.dir_name`.
- **BREAKING**: Moved `ImageArtifact.prompt` and `ImageArtifact.model` into `ImageArtifact.meta`.
- **BREAKING**: `ImageArtifact.format` is now required.
- **BREAKING**: Removed the `__all__` declaration from the `griptape.mixins` module.
- Updated `JsonArtifact` value converter to properly handle more types.
- `AudioArtifact` now subclasses `BlobArtifact` instead of `MediaArtifact`.
- `ImageArtifact` now subclasses `BlobArtifact` instead of `MediaArtifact`.
- Removed `__add__` method from `BaseArtifact`, implemented it where necessary.

### Fixed
- Crash when passing "empty" Artifacts or no Artifacts to `CohereRerankDriver`.

## [0.31.0] - 2024-09-03

**Note**: This release includes breaking changes. Please refer to the [Migration Guide](./MIGRATION.md#030x-to-031x) for details.

### Added
- Parameter `meta: dict` on `BaseEvent`.
- `AzureOpenAiTextToSpeechDriver`.
- Ability to use Event Listeners as Context Managers for temporarily setting the Event Bus listeners.
- `JsonSchemaRule` for instructing the LLM to output a JSON object that conforms to a schema.
- Ability to use Drivers Configs as Context Managers for temporarily setting the default Drivers.

### Changed
- **BREAKING**: Drivers, Loaders, and Engines now raise exceptions rather than returning `ErrorArtifacts`.
- **BREAKING**: Parameter `driver` on `BaseConversationMemory` renamed to `conversation_memory_driver`.
- **BREAKING**: `BaseConversationMemory.add_to_prompt_stack` now takes a `prompt_driver` parameter.
- **BREAKING**: `BaseConversationMemoryDriver.load` now returns `tuple[list[Run], dict]`. This represents the runs and metadata.
- **BREAKING**: `BaseConversationMemoryDriver.store` now takes `runs: list[Run]` and `metadata: dict` as input.
- **BREAKING**: Parameter `file_path` on `LocalConversationMemoryDriver` renamed to `persist_file` and is now type `Optional[str]`.
- **BREAKING**: Removed the `__all__` declaration from the `griptape.mixins` module.
- `Defaults.drivers_config.conversation_memory_driver` now defaults to `LocalConversationMemoryDriver` instead of `None`.
- `CsvRowArtifact.to_text()` now includes the header.

### Fixed
- Parsing streaming response with some OpenAI compatible services.
- Issue in `PromptSummaryEngine` if there are no artifacts during recursive summarization.
- Issue in `GooglePromptDriver` using Tools with no schema.
- Missing `maxTokens` inference parameter in `AmazonBedrockPromptDriver`.
- Incorrect model in `OpenAiDriverConfig`'s `text_to_speech_driver`.
- Crash when using `CohereRerankDriver` with `CsvRowArtifact`s.
- Crash when passing "empty" Artifacts or no Artifacts to `CohereRerankDriver`.


## [0.30.2] - 2024-08-26

### Fixed
- Ensure thread safety when publishing events by adding a thread lock to batch operations in `BaseEventListenerDriver`.
- `FileManagerTool` failing to save Artifacts created by `ExtractionTool` with a `CsvExtractionEngine`.

## [0.30.1] - 2024-08-21

Expand Down
Loading

0 comments on commit 89a800a

Please sign in to comment.