MCPcopy Create free account
hub / github.com/Azure-Samples/llama-index-python / init_settings

Function init_settings

backend/app/settings.py:11–27  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9
10
11def init_settings():
12 model_provider = os.getenv("MODEL_PROVIDER")
13 match model_provider:
14 case "openai":
15 init_openai()
16 case "ollama":
17 init_ollama()
18 case "anthropic":
19 init_anthropic()
20 case "gemini":
21 init_gemini()
22 case "azure-openai":
23 init_azure_openai()
24 case _:
25 raise ValueError(f"Invalid model provider: {model_provider}")
26 Settings.chunk_size = int(os.getenv("CHUNK_SIZE", "1024"))
27 Settings.chunk_overlap = int(os.getenv("CHUNK_OVERLAP", "20"))
28
29
30def init_ollama():

Callers 2

main.pyFile · 0.90
generate_datasourceFunction · 0.90

Calls 5

init_openaiFunction · 0.85
init_ollamaFunction · 0.85
init_anthropicFunction · 0.85
init_geminiFunction · 0.85
init_azure_openaiFunction · 0.85

Tested by

no test coverage detected