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

Add settings for custom base url #2594

Merged
merged 35 commits into from
Jun 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
da2d348
Add settings for custom base url and embedding dimension
DGdev91 Apr 19, 2023
b349f21
Merge branch 'master' into master
DGdev91 Apr 19, 2023
96e7650
Merge branch 'master' into master
ntindle Apr 24, 2023
04f6ffd
Merge branch 'Significant-Gravitas:master' into master
DGdev91 Apr 24, 2023
b7defd2
Update to milvus.py to load the configuration also in the init_collec…
DGdev91 Apr 24, 2023
f99269b
Merge branch 'master' into master
DGdev91 Apr 25, 2023
3eafdc1
Merge branch 'master' into master
ntindle Apr 27, 2023
cf5b45a
Update radismem.py to get rid of Config() loading
DGdev91 Apr 27, 2023
9a59b86
Update local.py to get rid of Config() loading
DGdev91 Apr 27, 2023
47e1516
Correct code format (python black)
DGdev91 Apr 27, 2023
56f77cc
Revert DEFAULT_EMBED_DIM name to EMBED_DIM to keep tests valid
DGdev91 Apr 27, 2023
4fc4895
Better description for EMBED_DIM setting
DGdev91 Apr 27, 2023
2072f64
Merge branch 'master' into master
DGdev91 Apr 27, 2023
09dbc71
Merge branch 'master' into master
ntindle Apr 27, 2023
1562deb
Set MockConfig to the type Config in Milvus test
DGdev91 Apr 30, 2023
0e7ec92
Fix formatting
DGdev91 Apr 30, 2023
f977d2f
Merge branch 'master' into master
DGdev91 Apr 30, 2023
4bb9db1
Merge branch 'master' into master
ntindle Apr 30, 2023
b27874a
Merge branch 'master' into master
DGdev91 May 3, 2023
2445a2f
Update Milvus test, using Config() instead of building a mock config
DGdev91 May 3, 2023
bb48512
Merge branch 'master' into master
DGdev91 May 5, 2023
1f99590
Merge branch 'master' into master
DGdev91 May 12, 2023
9fbf4a1
using the last milvus test code from main
DGdev91 May 13, 2023
f8f3631
Merge branch 'master' into master
DGdev91 May 13, 2023
e00cacd
Merge remote-tracking branch 'Significant-Gravitas/master'
DGdev91 May 25, 2023
f20fc0d
Remove embed_dim , no more needed after #4208
DGdev91 May 25, 2023
5cd9df3
Merge branch 'master' into master
DGdev91 May 31, 2023
8e4ad31
Merge branch 'master' into master
Pwuts Jun 7, 2023
4e871fb
Add example for OPENAI_BASE_URL
DGdev91 Jun 7, 2023
08eb93b
Merge branch 'master' into master
Pwuts Jun 9, 2023
2c73a1c
Merge branch 'master' into master
Pwuts Jun 9, 2023
c38a035
Merge branch 'master' into master
Pwuts Jun 9, 2023
1e41080
Merge branch 'master' into master
waynehamadi Jun 9, 2023
86eff79
Merge branch 'master' into master
Pwuts Jun 10, 2023
0d3060e
Merge branch 'master' into master
Pwuts Jun 10, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions .env.template
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ OPENAI_API_KEY=your-openai-api-key
## PROMPT_SETTINGS_FILE - Specifies which Prompt Settings file to use (defaults to prompt_settings.yaml)
# PROMPT_SETTINGS_FILE=prompt_settings.yaml

## OPENAI_API_BASE_URL - Custom url for the OpenAI API, useful for connecting to custom backends. No effect if USE_AZURE is true, leave blank to keep the default url
Pwuts marked this conversation as resolved.
Show resolved Hide resolved
# the following is an example:
# OPENAI_API_BASE_URL=http://localhost:443/v1

## AUTHORISE COMMAND KEY - Key to authorise commands
# AUTHORISE_COMMAND_KEY=y

Expand Down
2 changes: 2 additions & 0 deletions autogpt/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,8 @@
openai.api_type = self.openai_api_type
openai.api_base = self.openai_api_base
openai.api_version = self.openai_api_version
elif os.getenv("OPENAI_API_BASE_URL", None):
openai.api_base = os.getenv("OPENAI_API_BASE_URL")

Check warning on line 86 in autogpt/config/config.py

View check run for this annotation

Codecov / codecov/patch

autogpt/config/config.py#L86

Added line #L86 was not covered by tests
ntindle marked this conversation as resolved.
Show resolved Hide resolved

if self.openai_organization is not None:
openai.organization = self.openai_organization
Expand All @@ -95,11 +97,11 @@

# Backwards-compatibility shim for deprecated env variables
if os.getenv("USE_MAC_OS_TTS"):
default_tts_provider = "macos"

Check warning on line 100 in autogpt/config/config.py

View check run for this annotation

Codecov / codecov/patch

autogpt/config/config.py#L100

Added line #L100 was not covered by tests
elif self.elevenlabs_api_key:
default_tts_provider = "elevenlabs"

Check warning on line 102 in autogpt/config/config.py

View check run for this annotation

Codecov / codecov/patch

autogpt/config/config.py#L102

Added line #L102 was not covered by tests
elif os.getenv("USE_BRIAN_TTS"):
default_tts_provider = "streamelements"

Check warning on line 104 in autogpt/config/config.py

View check run for this annotation

Codecov / codecov/patch

autogpt/config/config.py#L104

Added line #L104 was not covered by tests
else:
default_tts_provider = "gtts"

Expand Down Expand Up @@ -249,7 +251,7 @@

def set_elevenlabs_voice_1_id(self, value: str) -> None:
"""Set the ElevenLabs Voice 1 ID value."""
self.elevenlabs_voice_id = value

Check warning on line 254 in autogpt/config/config.py

View check run for this annotation

Codecov / codecov/patch

autogpt/config/config.py#L254

Added line #L254 was not covered by tests

def set_elevenlabs_voice_2_id(self, value: str) -> None:
"""Set the ElevenLabs Voice 2 ID value."""
Expand All @@ -261,7 +263,7 @@

def set_custom_search_engine_id(self, value: str) -> None:
"""Set the custom search engine id value."""
self.google_custom_search_engine_id = value

Check warning on line 266 in autogpt/config/config.py

View check run for this annotation

Codecov / codecov/patch

autogpt/config/config.py#L266

Added line #L266 was not covered by tests

def set_debug_mode(self, value: bool) -> None:
"""Set the debug mode value."""
Expand Down