danielbalsam / surv_ai Goto Github PK
View Code? Open in Web Editor NEWA framework to empower forecasting using Large Language Models (LLMs)
Home Page: https://github.com/DanielBalsam/surv_ai
License: MIT License
A framework to empower forecasting using Large Language Models (LLMs)
Home Page: https://github.com/DanielBalsam/surv_ai
License: MIT License
429, message='Too Many Requests', url=URL('https://api.openai.com/v1/chat/completions')
Traceback (most recent call last):
File "[/mnt/Data/Projects/surv_ai/surv_ai/lib/llm/gpt.py](https://file+.vscode-resource.vscode-cdn.net/mnt/Data/Projects/surv_ai/surv_ai/lib/llm/gpt.py)", line 92, in _get_completion
response.raise_for_status()
File "[/Projects/surv_ai/venv/lib/python3.11/site-packages/aiohttp/client_reqrep.py](https://file+.vscode-resource.vscode-cdn.net/home/lawrence/Projects/surv_ai/venv/lib/python3.11/site-packages/aiohttp/client_reqrep.py)", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url=URL('https://api.openai.com/v1/chat/completions')
429, message='Too Many Requests', url=URL('https://api.openai.com/v1/chat/completions')
Traceback (most recent call last):
File "[/mnt/Data/Projects/surv_ai/surv_ai/lib/llm/gpt.py](https://file+.vscode-resource.vscode-cdn.net/mnt/Data/Projects/surv_ai/surv_ai/lib/llm/gpt.py)", line 92, in _get_completion
response.raise_for_status()
File "[/Projects/surv_ai/venv/lib/python3.11/site-packages/aiohttp/client_reqrep.py](https://file+.vscode-resource.vscode-cdn.net/home/lawrence/Projects/surv_ai/venv/lib/python3.11/site-packages/aiohttp/client_reqrep.py)", line 1005, in raise_for_status
raise ClientResponseError(
aiohttp.client_exceptions.ClientResponseError: 429, message='Too Many Requests', url=URL('https://api.openai.com/v1/chat/completions')
Wondering how you got around this, trying to run some of the examples...
from surv_ai import (
GPTClient,
Survey,
ToolBelt,
GoogleCustomSearchTool,
Knowledge
)
client = GPTClient(os.environ["OPEN_AI_API_KEY"])
survey = Survey(
client,
tool_belt=ToolBelt(
client,
tools=[
GoogleCustomSearchTool(
client,
os.environ["GOOGLE_API_KEY"],
os.environ["GOOGLE_SEARCH_ENGINE_ID"],
start_date="2023-01-01",
end_date="2023-05-01",
n_pages=10,
)
]
),
n_agents=10,
base_knowledge=[
Knowledge(
text="It is currently 2023/05/01, all the articles are from 2023.",
source="Additional context",
),
],
)
await survey.conduct(
"California experienced a significant amount of rainfall this winter.",
) # This should always returns high a confidence agreement.
TypeError Traceback (most recent call last)
Cell In[16], line 35
9 client = GPTClient(os.environ["OPEN_AI_API_KEY"])
11 survey = Survey(
12 client,
13 tool_belt=ToolBelt(
(...)
32 ],
33 )
---> 35 await survey.conduct(
36 "California experienced a significant amount of rainfall this winter.",
37 )
File C:\ProgramData\Anaconda3\lib\site-packages\surv_ai\core\survey.py:94, in Survey.conduct(self, hypothesis)
91 agents = 0
93 try:
---> 94 relevant_articles = await self.tool_belt.inspect(hypothesis, self.base_knowledge or [])
95 except NoMemoriesFoundException:
96 return SurveyResponse(
97 in_favor=0,
98 against=0,
(...)
102 uncertainty=0,
103 )
File C:\ProgramData\Anaconda3\lib\site-packages\surv_ai\lib\tools\tool_belt.py:84, in ToolBelt.inspect(self, original_prompt, base_knowledge, attempt)
81 knowledge += await tool.use(original_prompt, args)
83 if not knowledge and attempt < 3:
---> 84 knowledge = await self.inspect(original_prompt, attempt=attempt + 1)
85 elif not knowledge:
86 raise NoMemoriesFoundException()
TypeError: inspect() missing 1 required positional argument: 'base_knowledge'
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.