Git Product home page Git Product logo

Comments (10)

lemo366 avatar lemo366 commented on July 24, 2024

路径的问题

from zhipuai-sdk-python.

zhuzhaohua avatar zhuzhaohua commented on July 24, 2024

同问,没有回答吗?

from zhipuai-sdk-python.

jinsans avatar jinsans commented on July 24, 2024

请问怎么解决的呢

from zhipuai-sdk-python.

lemo366 avatar lemo366 commented on July 24, 2024

请问怎么解决的呢

我是因为路径问题导致的,你可以尝试将使用dir(zhipuai)查看是否有model_api

from zhipuai-sdk-python.

jinsans avatar jinsans commented on July 24, 2024

from zhipuai-sdk-python.

franplk avatar franplk commented on July 24, 2024

zhipuai的版本问题,你应该用的是 2.x.x;降级为1.0.7就可以了

from zhipuai-sdk-python.

andyzhou1982 avatar andyzhou1982 commented on July 24, 2024

2.0.1版本删除了zhipuai.model_api,新的初始化方法是zhipuai.ZhipuAI(api_key=os.environ.get("ZHIPUAI_API_KEY")),调用方法也不一样了,不是invoke了,用chat.completions.create

from zhipuai-sdk-python.

wailliai avatar wailliai commented on July 24, 2024

请问大佬,如果是LLMChain使用zhipuai,应该要怎么调用呢?使用invoke提示'zhipuai' has no attribute 'model_api'
chain = LLMChain(llm=model, prompt=prompt,output_parser=parser)
inputParams = {
"input":"讲一个笑话",
}
result = chain.invoke(input=inputParams)

from zhipuai-sdk-python.

jinsans avatar jinsans commented on July 24, 2024

from zhipuai-sdk-python.

andyzhou1982 avatar andyzhou1982 commented on July 24, 2024
import zhipuai
client = zhipuai.ZhipuAI(api_key=os.environ.get("ZHIPUAI_API_KEY"))
response = client.chat.completions.create(**params)

from zhipuai-sdk-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.