Giter Site home page Giter Site logo

danielbalsam / surv_ai Goto Github PK

View Code? Open in Web Editor NEW
96.0 9.0 3.0 603 KB

A framework to empower forecasting using Large Language Models (LLMs)

Home Page: https://github.com/DanielBalsam/surv_ai

License: MIT License

Python 56.44% Jupyter Notebook 43.56%
agents ai analysis artificial intelligence language large learning machine ml

surv_ai's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

tj07-dev yeq0 ego

surv_ai's Issues

hitting openAI rate limits

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...

examples don't work

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'

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.