Find answers from the community

Updated 5 months ago

how to get the list of all possible models used in OpenAI() ?

@kapa.ai how to get the list of all possible models used in OpenAI() ?
k
p
5 comments
Please stand by @praveenks30#120294 as I search the knowledge base. I normally take about 20 seconds or so. :wave:
----------------------
The knowledge sources provided do not include a direct method to get a list of all possible models that can be used with the OpenAI() function in LlamaIndex. However, you can refer to the OpenAI documentation or the OpenAI API for a list of available models.

For using a specific model with OpenAI(), you can specify the model name as a parameter. For example:

Plain Text
from llama_index.llms.openai import OpenAI
llm = OpenAI(model="gpt-3.5-turbo", temperature=0.1)

In the above code, "gpt-3.5-turbo" is the model being used. You can replace this with the name of any other available model.

For more details, you can refer to the LlamaIndex documentation ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
@kapa.ai how can I get the list of all other available models ?
Let me check the knowledge base for you. One moment! :books:
----------------------
To get a list of all available models in a specific module, you can use the list_models() function. However, the exact method may vary depending on the module you are using.

For example, if you are using the google.generativeai module, you can get a list of all available models as follows:

Plain Text
import google.generativeai as genai

for m in genai.list_models():
    if "generateContent" in m.supported_generation_methods:
        print(m.name)


This code will print the names of all models that support the generateContent method.

For other modules, you would need to refer to their specific documentation or API reference to find out how to list all available models.

Please note that the above code is based on the information provided in the knowledge sources ().
----------------------
Note: you can ask me a follow up question by @ mentioning me again :speech_balloon:
----------------------
Add a reply
Sign up and join the conversation on Discord