代码示例 / Python

python llama_index 配置


from llama_index.llms.openai import OpenAI



llm = OpenAI(

    model="gpt-3.5-turbo",

    api_key="sk-xxxxx",

    api_base="https://www.cokeapi.com/v1")

ret=llm.complete("Paul Graham is ")

print(ret)