Giter Club home page Giter Club logo

langchain_qianwen's People

Contributors

devinyf avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

langchain_qianwen's Issues

执行create_pandas_dataframe_agent出现问题

代码:
agent = create_pandas_dataframe_agent(llm,
df,
prefix=custom_prefix,
verbose=True)

agent("""validate the following hypothesis with t-test.
Null Hypothesis: the survived count of children(age < 12) is less than adult.
Alternate Hypothesis: the survived count of children(age < 12) is more than adult.if some python libs are required,import these libs at the beginning'""")
返回是专业的:
Action Input:

import numpy as np
from scipy.stats import ttest_ind

# Filter passengers into children and adults
children = df[df['Age'] < 12]
adults = df[df['Age'] >= 12]

# Count the number of survivors for each group
survivors_children = children['Survived'].sum()
survivors_adults = adults['Survived'].sum()

# Calculate the sample sizes
n_children = children.shape[0]
n_adults = adults.shape[0]

# Perform two-sample t-test
t_statistic, p_value = ttest_ind(children['Survived'], adults['Survived'], equal_var=False)

survivors_children, survivors_adults, t_statistic, p_value
```NameError: name 'py' is not definedThe error persists. It seems there's a misunderstanding here, as the `py` variable isn't defined anywhere in the code. Let me try running the corrected code without the reference to `py`.
生成python代码里面一直有pypython_repl_ast解析不了

跑example中的csv_agent.py,出现问题

我跑了csv_agent.py,出现如下问题,请问是怎么回事


TypeError Traceback (most recent call last)
Cell In[22], line 2
1 from langchain.agents import load_tools, AgentType, initialize_agent
----> 2 from langchain_qianwen import Qwen_v1
4 if name == "main":
5 llm = Qwen_v1(
6 # model_name="qwen-plus",
7 model_name="qwen-turbo",
8 # temperature=0.1,
9 )

File /Users/CX/PyProject/venv/lib/python3.9/site-packages/langchain_qianwen/init.py:1
----> 1 from .qwen_llm import Qwen_v1, BaseDashScope
2 from .qwen_chat_model import ChatQwen_v1
4 all = [
5 "Qwen_v1",
6 "ChatQwen_v1",
7 "BaseDashScope",
8 ]

File /Users/CX/PyProject/venv/lib/python3.9/site-packages/langchain_qianwen/qwen_llm.py:13
10 from langchain.schema.output import GenerationChunk
11 from langchain.callbacks.manager import (CallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun)
---> 13 from .commons import completion_with_retry, acompletion_with_retry, response_text_format, response_handler
14 from http import HTTPStatus
16 logger = logging.getLogger(name)

File /Users/CX/PyProject/venv/lib/python3.9/site-packages/langchain_qianwen/commons.py:16
10 from typing import Optional, Union, Callable, Any, AsyncGenerator
12 logger = logging.getLogger(name)
15 def completion_with_retry(
---> 16 llm_model: BaseLLM | BaseChatModel,
17 run_manager: Optional[CallbackManagerForLLMRun] = None,
18 **kwargs: Any
19 ) -> Any:
20 """Use tenacity to retry the completion call."""
21 retry_decorator = _create_retry_decorator(llm_model, run_manager=run_manager)

TypeError: unsupported operand type(s) for |: 'ModelMetaclass' and 'ModelMetaclass'

There is some "import error", anyone knows to solve it?

I running the example like this:

from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
from langchain_qianwen import ChatQwen_v1
from langchain.schema import (
HumanMessage,
)

if name == "main":
chat = ChatQwen_v1(
model_name="qwen-turbo",
streaming=True,
callbacks=[StreamingStdOutCallbackHandler()],
)

chat([HumanMessage(content="举例说明一下 PHP 为什么是世界上最好的语言")])

but get errors like:


ImportError Traceback (most recent call last)
Cell In[4], line 2
1 from langchain.callbacks.streaming_stdout import StreamingStdOutCallbackHandler
----> 2 from langchain_qianwen import ChatQwen_v1
3 from langchain.schema import (
4 HumanMessage,
5 )
7 if name == "main":

File ~/miniconda3/envs/aienv/lib/python3.10/site-packages/langchain_qianwen/init.py:1
----> 1 from .qwen_llm import Qwen_v1, BaseDashScope
2 from .qwen_chat_model import ChatQwen_v1
4 all = [
5 "Qwen_v1",
6 "ChatQwen_v1",
7 "BaseDashScope",
8 ]

File ~/miniconda3/envs/aienv/lib/python3.10/site-packages/langchain_qianwen/qwen_llm.py:13
10 from langchain.schema.output import GenerationChunk
11 from langchain.callbacks.manager import (CallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun)
---> 13 from .commons import completion_with_retry, acompletion_with_retry, response_text_format, response_handler
14 from http import HTTPStatus
16 logger = logging.getLogger(name)

File ~/miniconda3/envs/aienv/lib/python3.10/site-packages/langchain_qianwen/commons.py:2
1 from langchain.callbacks.manager import (CallbackManagerForLLMRun, AsyncCallbackManagerForLLMRun)
----> 2 from langchain.llms.base import create_base_retry_decorator
3 from langchain.llms.base import BaseLLM
4 from langchain.chat_models.base import BaseChatModel

ImportError: cannot import name 'create_base_retry_decorator' from 'langchain.llms.base' (/home/tb14/miniconda3/envs/aienv/lib/python3.10/site-packages/langchain/llms/base.py)

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.