recommended changes

This commit is contained in:
Siddhesh Agarwal
2024-10-31 20:39:24 +05:30
parent 25806221eb
commit c4674fc98f
3 changed files with 15 additions and 3 deletions
+1 -1
View File
@@ -50,7 +50,7 @@ First, authenticate your API keys by setting them in the environment variables:
$ export OPENAI_API_KEY="sk-..."
```
This pattern lets you keep your API keys private and out of your codebase. Other supported environment variables: `ANTHROPIC_API_KEY`, `XAI_API_KEY`, and `GROQ_API_KEY`.
This pattern allows you to keep your API keys private and out of your codebase. Other supported environment variables: `ANTHROPIC_API_KEY`, `XAI_API_KEY`, and `GROQ_API_KEY`.
Next, import Simplemind and start using it:
+1 -1
View File
@@ -1,7 +1,7 @@
from _context import sm
class SimpleMemoryPlugin(sm.BasePlugin):
class SimpleMemoryPlugin:
def __init__(self):
self.memories = [
"the earth has fictionally beeen destroyed.",
+13 -1
View File
@@ -1,8 +1,19 @@
from typing import Optional, Union
from typing import Literal, Optional, Union
from pydantic import Field, SecretStr, field_validator
from pydantic_settings import BaseSettings, SettingsConfigDict
logging_level = Literal["DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"]
class LoggingConfig(BaseSettings):
"""The class that holds all the logging settings for the application."""
enabled: bool = Field(False, description="Enable logging")
level: logging_level = Field("INFO", description="The logging level")
model_config = SettingsConfigDict(extra="forbid")
class Settings(BaseSettings):
"""The class that holds all the API keys for the application."""
@@ -23,6 +34,7 @@ class Settings(BaseSettings):
model_config = SettingsConfigDict(
env_file=".env", env_file_encoding="utf-8", case_sensitive=True, extra="ignore"
)
logging: LoggingConfig = LoggingConfig()
@field_validator("*", mode="before")
@classmethod