Skip to content

Commit

Permalink
fix Pydantic v2 errors
Browse files Browse the repository at this point in the history
  • Loading branch information
Pwuts committed Jul 4, 2024
1 parent c9501bd commit b7da031
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion forge/forge/llm/providers/llamafile/llamafile.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ class LlamafileConfiguration(ModelProviderConfiguration):


class LlamafileCredentials(ModelProviderCredentials):
api_key: SecretStr = SecretStr("sk-no-key-required")
api_key: Optional[SecretStr] = SecretStr("sk-no-key-required")
api_base: SecretStr = UserConfigurable( # type: ignore
default=SecretStr("http://localhost:8080/v1"), from_env="LLAMAFILE_API_BASE"
)
Expand Down
2 changes: 1 addition & 1 deletion forge/forge/llm/providers/multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ def _get_provider(self, provider_name: ModelProviderName) -> ChatModelProvider:
try:
settings.credentials = Credentials.from_env()
except ValidationError as e:
if credentials_field.required:
if credentials_field.is_required():
self._logger.debug(

Check warning on line 155 in forge/forge/llm/providers/multi.py

View check run for this annotation

Codecov / codecov/patch

forge/forge/llm/providers/multi.py#L155

Added line #L155 was not covered by tests
f"Could not load (required) {Credentials.__name__}"
)
Expand Down

0 comments on commit b7da031

Please sign in to comment.