Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]:最新版本运行ollma api报错如下 #229

Closed
wzsage opened this issue May 16, 2024 · 2 comments · Fixed by #230
Closed

[Bug]:最新版本运行ollma api报错如下 #229

wzsage opened this issue May 16, 2024 · 2 comments · Fixed by #230
Assignees
Labels
bug Something isn't working work in progress Work in progress

Comments

@wzsage
Copy link

wzsage commented May 16, 2024

AgentScope is an open-source project. To involve a broader community, we recommend asking your questions in English.

Describe the bug
A clear and concise description of what the bug is.
运行reactagent直接报错
To Reproduce
Steps to reproduce the behavior:

agentscope.init(model_configs=[{
"config_name": "my_ollama_chat_config",
"model_type": "ollama_chat",
"model_name": "qwen:32b",
"options": { # Parameters passed to the model when calling
"temperature": 0.5, "seed": 123,
},
"keep_alive": "5m", # Controls how long the model will stay loaded into memory
}])

Create agents

agent = ReActAgent(
name="assistant",
model_config_name="my_ollama_chat_config",
verbose=True,
service_toolkit=service_toolkit,
)
user = UserAgent(name="User")

Build

x = None
while True:
x = user(x)
if x.content == "exit":
break
x = agent(x)

Expected behavior
A clear and concise description of what you expected to happen.

Error messages
Detailed error messages.

Traceback (most recent call last):
File "D:\pyproject\agentscope\examples\conversation_with_react_agent\code\conversation_with_react_agent.py", line 100, in
x = agent(x)
File "D:\pyproject\agentscope\src\agentscope\agents\agent.py", line 294, in call
res = self.reply(*args, **kwargs)
File "D:\pyproject\agentscope\src\agentscope\agents\react_agent.py", line 164, in reply
prompt = self.model.format(self.memory.get_memory(), hint_msg)
File "D:\pyproject\agentscope\src\agentscope\models\ollama_model.py", line 269, in format
"content": system_content_template.format(
KeyError: 'index'

Environment (please complete the following information):

  • AgentScope Version: [0.0.4]
  • Python Version: [3.10]
  • OS: [e.g. macos, windows]

Additional context
Add any other context about the problem here.
agentscope – conversation_with_react_agent py 2024_5_16 21_58_52

@wzsage wzsage added the bug Something isn't working label May 16, 2024
@DavdGao
Copy link
Collaborator

DavdGao commented May 16, 2024

Thanks for your reporting. That's very strange to have a key named "index" here. We will try to locate this bug.

@DavdGao DavdGao linked a pull request May 17, 2024 that will close this issue
4 tasks
@DavdGao DavdGao self-assigned this May 17, 2024
@DavdGao DavdGao added the work in progress Work in progress label May 17, 2024
@DavdGao
Copy link
Collaborator

DavdGao commented May 17, 2024

The bug is fixed, please pull the repo to install the latest AgentScope library from source

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working work in progress Work in progress
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants