Skip to content

Commit

Permalink
Post merge fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
collindutter committed May 17, 2024
1 parent 11a5f8b commit e0e0adb
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 51 deletions.
6 changes: 2 additions & 4 deletions docs/griptape-framework/drivers/event-listener-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -134,10 +134,8 @@ agent = Agent(
)
],
config=StructureConfig(
global_drivers=StructureGlobalDriversConfig(
prompt_driver=OpenAiChatPromptDriver(
model="gpt-3.5-turbo", temperature=0.7
),
prompt_driver=OpenAiChatPromptDriver(
model="gpt-3.5-turbo", temperature=0.7
)
),
event_listeners=[
Expand Down
2 changes: 2 additions & 0 deletions griptape/config/base_structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
BaseImageQueryDriver,
BasePromptDriver,
BaseVectorStoreDriver,
BaseTextToSpeechDriver,
)
from griptape.utils import dict_merge

Expand All @@ -27,6 +28,7 @@ class BaseStructureConfig(BaseConfig, ABC):
conversation_memory_driver: Optional[BaseConversationMemoryDriver] = field(
default=None, kw_only=True, metadata={"serializable": True}
)
text_to_speech_driver: BaseTextToSpeechDriver = field(kw_only=True, metadata={"serializable": True})

def merge_config(self, config: dict) -> BaseStructureConfig:
base_config = self.to_dict()
Expand Down
5 changes: 5 additions & 0 deletions griptape/config/structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
DummyPromptDriver,
DummyImageQueryDriver,
BaseImageQueryDriver,
BaseTextToSpeechDriver,
DummyTextToSpeechDriver,
)


Expand All @@ -38,3 +40,6 @@ class StructureConfig(BaseStructureConfig):
conversation_memory_driver: Optional[BaseConversationMemoryDriver] = field(
default=None, kw_only=True, metadata={"serializable": True}
)
text_to_speech_driver: BaseTextToSpeechDriver = field(
default=Factory(lambda: DummyTextToSpeechDriver()), kw_only=True, metadata={"serializable": True}
)
45 changes: 0 additions & 45 deletions griptape/config/structure_global_drivers_config.py

This file was deleted.

2 changes: 1 addition & 1 deletion griptape/tasks/text_to_speech_task.py
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ def text_to_speech_engine(self) -> TextToSpeechEngine:
if self._text_to_speech_engine is None:
if self.structure is not None:
self._text_to_speech_engine = TextToSpeechEngine(
text_to_speech_driver=self.structure.config.global_drivers.text_to_speech_driver
text_to_speech_driver=self.structure.config.text_to_speech_driver
)
else:
raise ValueError("Audio Generation Engine is not set.")
Expand Down
1 change: 1 addition & 0 deletions tests/unit/config/test_amazon_bedrock_structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,7 @@ def test_to_dict(self, config):
"type": "LocalVectorStoreDriver",
},
"type": "AmazonBedrockStructureConfig",
"text_to_speech_driver": {"type": "DummyTextToSpeechDriver"},
}

def test_from_dict(self, config):
Expand Down
1 change: 1 addition & 0 deletions tests/unit/config/test_anthropic_structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ def test_to_dict(self, config):
},
},
"conversation_memory_driver": None,
"text_to_speech_driver": {"type": "DummyTextToSpeechDriver"},
}

def test_from_dict(self, config):
Expand Down
1 change: 1 addition & 0 deletions tests/unit/config/test_google_structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ def test_to_dict(self, config):
},
},
"conversation_memory_driver": None,
"text_to_speech_driver": {"type": "DummyTextToSpeechDriver"},
}

def test_from_dict(self, config):
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/config/test_openai_structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ def test_to_dict(self, config):
"prompt_driver": {
"type": "OpenAiChatPromptDriver",
"base_url": None,
"model": "gpt-4",
"model": "gpt-4o",
"organization": None,
"response_format": None,
"seed": None,
Expand All @@ -27,6 +27,7 @@ def test_to_dict(self, config):
"user": "",
},
"conversation_memory_driver": None,
"text_to_speech_driver": {"type": "DummyTextToSpeechDriver"},
"embedding_driver": {
"base_url": None,
"model": "text-embedding-3-small",
Expand Down
1 change: 1 addition & 0 deletions tests/unit/config/test_structure_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ def test_to_dict(self, config):
"embedding_driver": {"type": "DummyEmbeddingDriver"},
"type": "DummyVectorStoreDriver",
},
"text_to_speech_driver": {"type": "DummyTextToSpeechDriver"},
}

def test_from_dict(self, config):
Expand Down

0 comments on commit e0e0adb

Please sign in to comment.