Module llm¶
get_azure_llm(engine='gpt-4o')
¶
Get the Azure OpenAI language model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
engine
|
str
|
The engine to use for the Azure OpenAI model. Default is "gpt-4o". |
'gpt-4o'
|
Returns:
| Name | Type | Description |
|---|---|---|
AzureOpenAI |
AzureOpenAI
|
An instance of the AzureOpenAI language model. |
Source code in nbs/llm.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | |
get_gemini_llm(model='gemini-1.5-flash')
¶
Get the Gemini language model.
This function configures the Gemini API using the API key obtained from the environment variables and returns an instance of the GenerativeModel.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str
|
The model to use for the Gemini language model. Default is "gemini-1.5-flash". |
'gemini-1.5-flash'
|
Returns:
| Name | Type | Description |
|---|---|---|
GenerativeModel |
GenerativeModel
|
An instance of the GenerativeModel. |
Source code in nbs/llm.py
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 | |
get_vertex_llm(model='gemini-1.5-flash-001')
¶
Get the Vertex language model.
This function configures the Vertex API using the project ID and API key obtained from the environment variables and returns an instance of the Vertex model.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
model
|
str
|
The model to use for the Vertex language model. Default is "gemini-1.5-flash-001". |
'gemini-1.5-flash-001'
|
Returns:
| Name | Type | Description |
|---|---|---|
Vertex |
Vertex
|
An instance of the Vertex language model. |
Source code in nbs/llm.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 | |