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

npm run example:scrape Not working as intended (Or is it?) #4

Open
wowpatrick opened this issue Jun 17, 2023 · 3 comments
Open

npm run example:scrape Not working as intended (Or is it?) #4

wowpatrick opened this issue Jun 17, 2023 · 3 comments

Comments

@wowpatrick
Copy link

Hi there,

just wanted to try out the scraping example by doing the following:

  1. git clone https://github.com/team-openpm/workgpt.git
  2. npm install
  3. Replace https://github.com/team-openpm/workgpt/blob/master/examples/scrape.ts#L31 with gpt-3.5-turbo and add apiKey: "my-key" below.
  4. npm run example:calculate

I get the result

<<< assistant:      {
<<< assistant:        "role": "assistant",
<<< assistant:        "content": "I'm sorry, but as an AI language model, I don't have the ability to scrape data from websites. However, I can suggest a way for you to get the featured funding rounds of companies on Crunchbase. \n\nYou can visit the Crunchbase website and navigate to the \"Funding Rounds\" section of a company's profile. This section will display the company's most recent funding rounds, including the amount raised, the investors involved, and the date of the funding round. Additionally, you can use the search bar on the Crunchbase homepage to search for companies and view their funding rounds."
<<< assistant:      }

As I understood the point was to enrich the request to ChatGPT with prevously scraped data which seems not to be the case. Or am I missing something?

Note: For some reason I get the following error messages with some models, even though the model name does seem to be available according to the OpenAI documentation: https://platform.openai.com/docs/models/model-endpoint-compatibility

Error: OpenAI API responded with 404: {
    "error": {
        "message": "The model: `gpt-4-0613` does not exist",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}
@Clish254
Copy link

Hi there,

just wanted to try out the scraping example by doing the following:

  1. git clone https://github.com/team-openpm/workgpt.git
  2. npm install
  3. Replace https://github.com/team-openpm/workgpt/blob/master/examples/scrape.ts#L31 with gpt-3.5-turbo and add apiKey: "my-key" below.
  4. npm run example:calculate

I get the result

<<< assistant:      {
<<< assistant:        "role": "assistant",
<<< assistant:        "content": "I'm sorry, but as an AI language model, I don't have the ability to scrape data from websites. However, I can suggest a way for you to get the featured funding rounds of companies on Crunchbase. \n\nYou can visit the Crunchbase website and navigate to the \"Funding Rounds\" section of a company's profile. This section will display the company's most recent funding rounds, including the amount raised, the investors involved, and the date of the funding round. Additionally, you can use the search bar on the Crunchbase homepage to search for companies and view their funding rounds."
<<< assistant:      }

As I understood the point was to enrich the request to ChatGPT with prevously scraped data which seems not to be the case. Or am I missing something?

Note: For some reason I get the following error messages with some models, even though the model name does seem to be available according to the OpenAI documentation: https://platform.openai.com/docs/models/model-endpoint-compatibility

Error: OpenAI API responded with 404: {
    "error": {
        "message": "The model: `gpt-4-0613` does not exist",
        "type": "invalid_request_error",
        "param": null,
        "code": "model_not_found"
    }
}

To fix the model not found error try to use one of the models returned by the GET https://api.openai.com/v1/models endpoint in the openai api. Also try to change your prompt to this

  const result = await runner.runWithDirective(
    `
        Your purpose is to extract featured funding rounds from a website
        Follow the instructions below. Think step by step.
        1. Navigate to https://www.crunchbase.com
        2. Extract the text of the page and find the Featured Funding
           rounds table data.
        3. Call WorkGptControl.onFinish with the parsed Featured Funding Rounds.
      `
  )

@maccman
Copy link
Member

maccman commented Jun 23, 2023

You're using the wrong model - you need to use gpt-3.5-turbo-0613 or gpt-4-061

@maccman
Copy link
Member

maccman commented Jun 23, 2023

Perhaps your OpenAI account doesn't have access to the function calling?

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

3 participants