krohling / bondai Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
Was planning to try out the package but it just doesn't install using the command.
pip install bondai
This returns a numpy version error. Fixed that by removing the specific version in the requirements.txt but then it returned a pre-commit version error. Did the same here and got another couple of errors but it showed the message that the package was installed successfully. However when trying to run the toy example from the docs, it returns the error: " No module named bondai".
Using the google_search tool
Thought: By using this query, I aim to find search results that might contain a direct URL to John McCarthy's photo on the Stanford website.
Arguments
query: John McCarthy photo site:jmc.stanford.edu
count: 20
page: 1
An Error occured: <HttpError 400 when requesting https://customsearch.googleapis.com/customsearch/v1?q=John+McCarthy+photo+site%3Ajmc.stanford.edu&cx=500b5dd06afd248bb&start=0&num=20&key=AIzaSyAwHX-cA2ql81tbyczUAYAMajNe3qQ_vGA&alt=json returned "Request contains an invalid argument.". Details: "[{'message': 'Request contains an invalid argument.', 'domain': 'global', 'reason': 'badRequest'}]">
Error:
{
"error": {
"code": 400,
"message": "Request contains an invalid argument.",
"errors": [
{
"message": "Request contains an invalid argument.",
"domain": "global",
"reason": "badRequest"
}
],
"status": "INVALID_ARGUMENT"
}
}
If you change num=20
in the URL to a number less than 5 it works.
E.G:
{
"kind": "customsearch#search",
"url": {
"type": "application/json",
"template": "https://www.googleapis.com/customsearch/v1?q={searchTerms}&num={count?}&start={startIndex?}&lr={language?}&safe={safe?}&cx={cx?}&sort={sort?}&filter={filter?}&gl={gl?}&cr={cr?}&googlehost={googleHost?}&c2coff={disableCnTwTranslation?}&hq={hq?}&hl={hl?}&siteSearch={siteSearch?}&siteSearchFilter={siteSearchFilter?}&exactTerms={exactTerms?}&excludeTerms={excludeTerms?}&linkSite={linkSite?}&orTerms={orTerms?}&relatedSite={relatedSite?}&dateRestrict={dateRestrict?}&lowRange={lowRange?}&highRange={highRange?}&searchType={searchType}&fileType={fileType?}&rights={rights?}&imgSize={imgSize?}&imgType={imgType?}&imgColorType={imgColorType?}&imgDominantColor={imgDominantColor?}&alt=json"
},
"queries": {
"request": [
{
"title": "Google Custom Search - John McCarthy photo",
"totalResults": "49000000",
"searchTerms": "John McCarthy photo",
"count": 4,
"startIndex": 1,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "500b5dd06afd248bb"
}
],
"nextPage": [
{
"title": "Google Custom Search - John McCarthy photo",
"totalResults": "49000000",
"searchTerms": "John McCarthy photo",
"count": 4,
"startIndex": 5,
"inputEncoding": "utf8",
"outputEncoding": "utf8",
"safe": "off",
"cx": "500b5dd06afd248bb"
}
]
},
"context": {
"title": "Aura"
},
"searchInformation": {
"searchTime": 0.219098,
"formattedSearchTime": "0.22",
"totalResults": "49000000",
"formattedTotalResults": "49,000,000"
},
"items": [
{
"kind": "customsearch#result",
"title": "jon-mccarthy-photo Jon McCarthy Photo",
"htmlTitle": "<b>jon</b>-<b>mccarthy</b>-<b>photo Jon McCarthy Photo</b>",
"link": "https://www.jonmccarthyphoto.com/",
"displayLink": "www.jonmccarthyphoto.com",
"snippet": "Portfolio- AT THE SHOW AT THE FARM IN THE PRESS -2023 Shows- -2022 Shows- INSTAGRAM | FACEBOOK.",
"htmlSnippet": "Portfolio- AT THE SHOW AT THE FARM IN THE PRESS -2023 Shows- -2022 Shows- INSTAGRAM | FACEBOOK.",
"cacheId": "szssU1TA40YJ",
// etc
Hello,
I've seen such errors before when the filename is the same as the package name, however, I was just testing the InMemoryArchivalMemoryDataSource
functionality using the example given in the documentation. Please can you give suggestions on how to resolve this?
playground.py:
import os
key = os.environ["OPENAI_API_KEY"]
from bondai.memory.archival.datasources import InMemoryArchivalMemoryDataSource
from bondai.models.openai import OpenAIEmbeddingModel, OpenAIModelNames
# Initialize an In-Memory Archival Memory Data Source
in_memory_archival = InMemoryArchivalMemoryDataSource(
embedding_model=OpenAIEmbeddingModel(OpenAIModelNames.TEXT_EMBEDDING_ADA_002)
)
# Insert and search content
in_memory_archival.insert("Temporary archival data")
results = in_memory_archival.search("archival data")
print(results)
Error:
File "/Users/username/project/bondai_trial/playground.py", line 4, in <module>
from bondai.memory.archival.datasources import InMemoryArchivalMemoryDataSource
File "/Users/username/merck project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/__init__.py", line 1, in <module>
from .memory_manager import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/memory_manager.py", line 10, in <module>
from .conversation.datasources import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/conversation/__init__.py", line 1, in <module>
from .datasources import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/conversation/datasources.py", line 6, in <module>
from bondai.agents.messages import (
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/agents/__init__.py", line 1, in <module>
from .conversational_agent import ConversationalAgent
File "/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/agents/conversational_agent.py", line 8, in <module>
from bondai.memory import MemoryManager
ImportError: cannot import name 'MemoryManager' from partially initialized module 'bondai.memory' (most likely due to a circular import) (/Users/username/project/bondai_trial/trial_venv/lib/python3.11/site-packages/bondai/memory/__init__.py)
File structure:
|- trial_env
|- playground.py
Here, trial_env is my virtual environment
valid question
It's a good idea, this could be pretty fun. Well I'd love someone that is able to run a fork off this, I put a lot of hours into this and the senior dev doesn't have the time, so if there was an active fork of this I could split my time and it be better for everyone because it rushes him less. I'm obsessed with this currently. Hop on our discord btw https://discord.gg/QeNgRqFz
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.