Comments (10)
路径的问题
from zhipuai-sdk-python.
同问,没有回答吗?
from zhipuai-sdk-python.
请问怎么解决的呢
from zhipuai-sdk-python.
请问怎么解决的呢
我是因为路径问题导致的,你可以尝试将使用dir(zhipuai)查看是否有model_api
from zhipuai-sdk-python.
from zhipuai-sdk-python.
zhipuai的版本问题,你应该用的是 2.x.x;降级为1.0.7就可以了
from zhipuai-sdk-python.
2.0.1版本删除了zhipuai.model_api,新的初始化方法是zhipuai.ZhipuAI(api_key=os.environ.get("ZHIPUAI_API_KEY")),调用方法也不一样了,不是invoke了,用chat.completions.create
from zhipuai-sdk-python.
请问大佬,如果是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.
from zhipuai-sdk-python.
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)
- API有支持的Function Call的计划吗
- 劳烦给出异步调用后,如何接受真实的response HOT 3
- self._logger.debug("Dispatching %s...", event) HOT 1
- [1234][网络错误,错误id:8168867886816165954,请联系客服。]
- 请问如何调用创建的应用? HOT 1
- 文件上传可否多元化?
- API 启动报错 401 HOT 1
- 官网和github开源的sdk版本差距有点大 HOT 5
- pydantic 依赖冲突 HOT 2
- zhipuai api 如何获取接口调用时间?
- 这个sdk已经废弃了吗
- zhipuai.core._errors.APITimeoutError: Request Timeout
- 是否需要OpenAI SDK的 ChatCompletion 包装?方便兼容其他LangChain等基于openai体系的应用? HOT 3
- 调用 ChatGLM-Pro API 接口进行多轮对话问题 HOT 2
- AttributeError: module 'zhipuai' has no attribute 'model_api' HOT 1
- 关于模型`prompt`参数列表长度为奇数的疑问。 HOT 3
- AttributeError: partially initialized module 'zhipuai' has no attribute 'model_api' (most likely due to a circular import)
- 希望用一个asyncio的API
- async_invoke输出如何获取content
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from zhipuai-sdk-python.