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

Function init_anthropic

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

Source from the content-addressed store, hash-verified

98
99
100def init_anthropic():
101 from llama_index.llms.anthropic import Anthropic
102 from llama_index.embeddings.huggingface import HuggingFaceEmbedding
103
104 model_map: Dict[str, str] = {
105 "claude-3-opus": "claude-3-opus-20240229",
106 "claude-3-sonnet": "claude-3-sonnet-20240229",
107 "claude-3-haiku": "claude-3-haiku-20240307",
108 "claude-2.1": "claude-2.1",
109 "claude-instant-1.2": "claude-instant-1.2",
110 }
111
112 embed_model_map: Dict[str, str] = {
113 "all-MiniLM-L6-v2": "sentence-transformers/all-MiniLM-L6-v2",
114 "all-mpnet-base-v2": "sentence-transformers/all-mpnet-base-v2",
115 }
116
117 Settings.llm = Anthropic(model=model_map[os.getenv("MODEL")])
118 Settings.embed_model = HuggingFaceEmbedding(
119 model_name=embed_model_map[os.getenv("EMBEDDING_MODEL")]
120 )
121
122
123def init_gemini():

Callers 1

init_settingsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected