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

How to ask full forecasting questions? #1

Open
dpaleka opened this issue Sep 16, 2024 · 1 comment
Open

How to ask full forecasting questions? #1

dpaleka opened this issue Sep 16, 2024 · 1 comment

Comments

@dpaleka
Copy link

dpaleka commented Sep 16, 2024

I want to run the forecaster on some project of mine. Concretely, I have questions with fields (title, resolution_criteria, resolution_date and created_date) (similar to what Metaculus API has); and I want to instantiate your forecaster to give a forecast on this question, if the forecaster was run e.g. on forecast_date (say 1 May 2024).

What is the data one needs to send to the forecasting_search_local endpoint? Could you perhaps provide an example?

@justinphan3110cais
Copy link
Collaborator

justinphan3110cais commented Nov 4, 2024

Hi.

async def forecasting_search_local(data: dict) -> str:
    model = data['model']
    messages = data['messages']
    breadth = data.get('breadth')
    plannerPrompt = data.get('plannerPrompt')
    factorized_prompt = data.get('factorizedPrompt')
    publisherPrompt = data.get('publisherPrompt')
    search_type = data.get('search_type')
    before_timestamp = data.get('beforeTimestamp')

    multi_agents = ForecastingMultiAgents(model, 
                                          breadth, 
                                          plannerPrompt, 
                                          publisherPrompt, 
                                          search_type, 
                                          before_timestamp,
                                          factorized_prompt)

    response = multi_agents.completions(messages)
    
    # Collect the full response
    full_response = ""
    async for chunk in response:
        full_response += chunk
    return full_response

For the function above you only need to worry about the messages which is something similiar to OpenAI's api input:
[dict(role="user", content=question)]. We use breadth from 5 to 7, you can find the prompts in prompts.py which are the default value if you not passing anything. beforeTimestamp is where you limit the news article for the sources

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants