Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

[Bug]: WikipediaToolSpec--BadRequestError: Error code: 400 #879

Open
Alina-Luo opened this issue Jan 21, 2024 · 0 comments
Open

[Bug]: WikipediaToolSpec--BadRequestError: Error code: 400 #879

Alina-Luo opened this issue Jan 21, 2024 · 0 comments
Labels
bug Something isn't working triage

Comments

@Alina-Luo
Copy link
Contributor

Bug Description

Version 1:
BadRequestError: Error code: 400 - {'error': {'message': "This model's maximum context length is 4097 tokens. However, your messages resulted in 13509 tokens (13312 in the messages, 197 in the functions). Please reduce the length of the messages or functions.", 'type': 'invalid_request_error', 'param': 'messages', 'code': 'context_length_exceeded'}}

Version 2:
(verbose=True)

Added user message to memory: Who is Ben Afflecks spouse?
=== Calling Function ===
Calling function: search_data with args: {
"query": "Ben Affleck spouse"
}
Got output: Error: 'str' object has no attribute 'get_doc_id'

=== Calling Function ===
Calling function: search_data with args: {
"query": "Ben Affleck spouse"
}
Got output: Error: 'str' object has no attribute 'get_doc_id'

...

Version

0.0.74

Steps to Reproduce

Version 1:
from llama_hub.tools.wikipedia import WikipediaToolSpec
from llama_index.agent import OpenAIAgent

tool_spec = WikipediaToolSpec()

agent = OpenAIAgent.from_tools(tool_spec.to_tool_list())

agent.chat('Who is Ben Afflecks spouse?')

Version 2:
from llama_hub.tools.wikipedia.base import WikipediaToolSpec
from llama_index.tools.tool_spec.load_and_search import LoadAndSearchToolSpec

wiki_spec = WikipediaToolSpec()
tool = wiki_spec.to_tool_list()[1]

agent = OpenAIAgent.from_tools(
LoadAndSearchToolSpec.from_defaults(tool).to_tool_list(), verbose=True
)
agent.chat('Who is Ben Afflecks spouse?')

Relevant Logs/Tracbacks

No response

@Alina-Luo Alina-Luo added bug Something isn't working triage labels Jan 21, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working triage
Projects
None yet
Development

No branches or pull requests

1 participant