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

fix(agent, forge): Silence Pydantic v2 protected namespace model_ warning #7340

Merged
merged 2 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
3 changes: 3 additions & 0 deletions autogpt/autogpt/agent_factory/profile_generator.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
)
from forge.models.config import SystemConfiguration, UserConfigurable
from forge.models.json_schema import JSONSchema
from pydantic import ConfigDict

from autogpt.app.config import AppConfig

Expand Down Expand Up @@ -140,6 +141,8 @@ class AgentProfileGeneratorConfiguration(SystemConfiguration):
).model_dump()
)

model_config = ConfigDict(protected_namespaces=())


class AgentProfileGenerator(PromptStrategy):
default_configuration: AgentProfileGeneratorConfiguration = (
Expand Down
4 changes: 3 additions & 1 deletion forge/forge/components/action_history/action_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from typing import Callable, Iterator, Optional

from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict

Check warning on line 5 in forge/forge/components/action_history/action_history.py

View check run for this annotation

Codecov / codecov/patch

forge/forge/components/action_history/action_history.py#L5

Added line #L5 was not covered by tests

from forge.agent.components import ConfigurableComponent
from forge.agent.protocols import AfterExecute, AfterParse, MessageProvider
Expand All @@ -25,6 +25,8 @@
full_message_count: int = 4
"""Number of latest non-summarized messages to include in the history"""

model_config = ConfigDict(protected_namespaces=())

Check warning on line 28 in forge/forge/components/action_history/action_history.py

View check run for this annotation

Codecov / codecov/patch

forge/forge/components/action_history/action_history.py#L28

Added line #L28 was not covered by tests


class ActionHistoryComponent(
MessageProvider,
Expand Down
4 changes: 3 additions & 1 deletion forge/forge/components/web/selenium.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from urllib.request import urlretrieve

from bs4 import BeautifulSoup
from pydantic import BaseModel
from pydantic import BaseModel, ConfigDict
from selenium.common.exceptions import WebDriverException
from selenium.webdriver.chrome.options import Options as ChromeOptions
from selenium.webdriver.chrome.service import Service as ChromeDriverService
Expand Down Expand Up @@ -69,6 +69,8 @@ class WebSeleniumConfiguration(BaseModel):
browse_spacy_language_model: str = "en_core_web_sm"
"""Spacy language model used for chunking text"""

model_config = ConfigDict(protected_namespaces=())


class WebSeleniumComponent(
DirectiveProvider, CommandProvider, ConfigurableComponent[WebSeleniumConfiguration]
Expand Down
2 changes: 2 additions & 0 deletions forge/forge/llm/providers/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,8 @@ class ModelResponse(BaseModel):
completion_tokens_used: int
model_info: ModelInfo

model_config = ConfigDict(protected_namespaces=())


class ModelProviderConfiguration(SystemConfiguration):
retries_per_request: int = UserConfigurable(7)
Expand Down
Loading