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

Refactor how configs work #765

Merged
merged 9 commits into from
May 20, 2024
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
10 changes: 4 additions & 6 deletions docs/examples/multiple-agent-shared-memory.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from griptape.engines import VectorQueryEngine, PromptSummaryEngine, CsvExtracti
from griptape.memory import TaskMemory
from griptape.artifacts import TextArtifact
from griptape.memory.task.storage import TextArtifactStorage
from griptape.config import StructureConfig, StructureGlobalDriversConfig
from griptape.config import StructureConfig


AZURE_OPENAI_ENDPOINT_1 = os.environ["AZURE_OPENAI_ENDPOINT_1"]
Expand Down Expand Up @@ -59,11 +59,9 @@ loader = Agent(
WebScraper()
],
config=StructureConfig(
global_drivers=StructureGlobalDriversConfig(
prompt_driver=azure_prompt_driver,
vector_store_driver=mongo_driver,
embedding_driver=azure_embedding_driver
)
prompt_driver=azure_prompt_driver,
vector_store_driver=mongo_driver,
embedding_driver=azure_embedding_driver
),
)
asker = Agent(
Expand Down
2 changes: 1 addition & 1 deletion docs/griptape-framework/data/chunkers.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ from griptape.chunkers import TextChunker
from griptape.tokenizers import OpenAiTokenizer
TextChunker(
# set an optional custom tokenizer
tokenizer=OpenAiTokenizer(model="gpt-4"),
tokenizer=OpenAiTokenizer(model="gpt-4o"),
# optionally modify default number of tokens
max_tokens=100
).chunk("long text")
Expand Down
11 changes: 3 additions & 8 deletions docs/griptape-framework/drivers/embedding-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -174,18 +174,13 @@ from griptape.drivers import (
OpenAiChatPromptDriver,
VoyageAiEmbeddingDriver,
)
from griptape.config import (
StructureGlobalDriversConfig,
StructureConfig,
)
from griptape.config import StructureConfig

agent = Agent(
tools=[WebScraper(), TaskMemoryClient(off_prompt=False)],
config=StructureConfig(
global_drivers=StructureGlobalDriversConfig(
prompt_driver=OpenAiChatPromptDriver(model="gpt-4"),
embedding_driver=VoyageAiEmbeddingDriver(),
)
prompt_driver=OpenAiChatPromptDriver(model="gpt-4o"),
embedding_driver=VoyageAiEmbeddingDriver(),
),
)

Expand Down
8 changes: 3 additions & 5 deletions docs/griptape-framework/drivers/event-listener-drivers.md
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ The [AwsIotCoreEventListenerDriver](../../reference/griptape/drivers/event_liste
```python
import os

from griptape.config import StructureConfig, StructureGlobalDriversConfig
from griptape.config import StructureConfig
from griptape.drivers import AwsIotCoreEventListenerDriver, OpenAiChatPromptDriver
from griptape.events import (
EventListener,
Expand All @@ -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
Loading
Loading