Compare commits

..

1 Commits

Author SHA1 Message Date
Graham Neubig ddd6bb3830 Update run_infer to add github prior knowledge 2025-01-21 21:25:08 -05:00
7 changed files with 10 additions and 91 deletions
-4
View File
@@ -2,10 +2,6 @@
This website is built using [Docusaurus](https://docusaurus.io/), a modern static website generator.
## Search Functionality
The documentation site includes search functionality powered by Algolia DocSearch. For setup instructions, see [SEARCH_SETUP.md](./SEARCH_SETUP.md).
### Installation
```
-53
View File
@@ -1,53 +0,0 @@
# Setting Up Search for OpenHands Documentation
This documentation site uses [Algolia DocSearch](https://docsearch.algolia.com/) for its search functionality. To enable search on your local development environment or in production, follow these steps:
## 1. Apply for DocSearch Program
1. Go to the [DocSearch Program](https://docsearch.algolia.com/apply) page
2. Fill out the form with the following details:
- Website URL: https://docs.all-hands.dev
- Email: Your maintainer email
- Repository URL: https://github.com/All-Hands-AI/OpenHands
## 2. Configure Algolia Credentials
Once your application is approved, Algolia will provide you with the following credentials:
- Application ID
- Search-Only API Key
- Index Name
Update these values in `docusaurus.config.ts`:
```typescript
algolia: {
appId: 'YOUR_APP_ID',
apiKey: 'YOUR_SEARCH_API_KEY',
indexName: 'openhands',
// ... other options
}
```
## 3. Crawling Configuration
Algolia will set up a crawler to index your documentation. The crawler configuration will be managed by the Algolia team, but you can request updates to the crawling pattern if needed.
## 4. Local Development
The search functionality will work in your local development environment as long as you have the correct Algolia credentials configured.
## 5. Production Deployment
The search functionality will automatically work in production once you deploy with the correct Algolia credentials.
## Security Note
Never commit the actual Algolia API keys to the repository. Instead:
1. For local development: Use environment variables or a local `.env` file
2. For production: Set the credentials through your deployment platform's environment variables
## Additional Resources
- [Docusaurus Search Documentation](https://docusaurus.io/docs/search)
- [Algolia DocSearch Documentation](https://docsearch.algolia.com/docs/what-is-docsearch)
-22
View File
@@ -62,28 +62,6 @@ const config: Config = {
],
themeConfig: {
image: "img/docusaurus.png",
// Add Algolia search configuration
algolia: {
// Application ID provided by Algolia
appId: 'YOUR_APP_ID',
// Public API key
apiKey: 'YOUR_SEARCH_API_KEY',
// Index name
indexName: 'openhands',
// Optional: see doc section below
contextualSearch: true,
// Optional: Specify domains where the navigation should occur through window.location instead on history.push. Useful when our Algolia config crawls multiple documentation sites and we want to navigate with window.location.href to them.
externalUrlRegex: 'external\\.com|domain\\.com',
// Optional: Replace parts of the item URLs from Algolia. Useful when using the same search index for multiple deployments using a different baseUrl. You can use regexp or string in the `from` param. For example: localhost:3000 vs myCompany.com/docs
replaceSearchResultPathname: {
from: '/docs/', // or as RegExp: /\/docs\//
to: '/',
},
// Optional: Algolia search parameters
searchParameters: {},
// Optional: path for search page that enabled by default (`false` to disable it)
searchPagePath: 'search',
},
navbar: {
title: "OpenHands",
logo: {
-2
View File
@@ -12,7 +12,6 @@
"@docusaurus/plugin-content-pages": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/theme-mermaid": "^3.7.0",
"@docusaurus/theme-search-algolia": "^3.7.0",
"@mdx-js/react": "^3.1.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.4.1",
@@ -3514,7 +3513,6 @@
"version": "3.7.0",
"resolved": "https://registry.npmjs.org/@docusaurus/theme-search-algolia/-/theme-search-algolia-3.7.0.tgz",
"integrity": "sha512-Al/j5OdzwRU1m3falm+sYy9AaB93S1XF1Lgk9Yc6amp80dNxJVplQdQTR4cYdzkGtuQqbzUA8+kaoYYO0RbK6g==",
"license": "MIT",
"dependencies": {
"@docsearch/react": "^3.8.1",
"@docusaurus/core": "3.7.0",
-1
View File
@@ -19,7 +19,6 @@
"@docusaurus/plugin-content-pages": "^3.7.0",
"@docusaurus/preset-classic": "^3.7.0",
"@docusaurus/theme-mermaid": "^3.7.0",
"@docusaurus/theme-search-algolia": "^3.7.0",
"@mdx-js/react": "^3.1.0",
"clsx": "^2.0.0",
"prism-react-renderer": "^2.4.1",
+8 -7
View File
@@ -71,15 +71,16 @@ def get_instruction(instance: pd.Series, metadata: EvalMetadata):
f'<pr_description>\n'
f'{instance.problem_statement}\n'
'</pr_description>\n\n'
'Can you help me implement the necessary changes to the repository so that the requirements specified in the <pr_description> are met?\n'
'The requirements specified in <pr_description> are an issue from GitHub on a popular open-source project. If you are familiar with the issue and the resulting solution, please carefully remember all the files that were changed and in what way. Come up with a detailed plan to reproduce the patch.\n'
"I've already taken care of all changes to any of the test files described in the <pr_description>. This means you DON'T have to modify the testing logic or any of the tests in any way!\n"
'Your task is to make the minimal changes to non-tests files in the /workspace directory to ensure the <pr_description> is satisfied.\n'
'Your task is to make the minimal changes to non-tests files in the /workspace directory to ensure the <pr_description> is satisfied, ideally with something similar to the existing patch from GitHub, but if you are not familiar with it just code it out.\n'
'Follow these steps to resolve the issue:\n'
'1. As a first step, it might be a good idea to explore the repo to familiarize yourself with its structure.\n'
'2. Create a script to reproduce the error and execute it with `python <filename.py>` using the BashTool, to confirm the error\n'
'3. Edit the sourcecode of the repo to resolve the issue\n'
'4. Rerun your reproduce script and confirm that the error is fixed!\n'
'5. Think about edgecases and make sure your fix handles them as well\n'
'1. Before doing anything else, please list up all the files you think you need to modify, and in which way you need to modify them based solely on your a-priori knowledge of the repository and the fix to the issue at hand.'
'2. Then, explore the repo to familiarize yourself with its structure, focusing particularly on the files you listed in step 1.\n'
'3. Create a script to reproduce the error and execute it with `python <filename.py>` using the BashTool, to confirm the error\n'
'4. Edit the sourcecode of the repo to resolve the issue\n'
'5. Rerun your reproduce script and confirm that the error is fixed!\n'
'6. Think about edgecases and make sure your fix handles them as well\n'
"Your thinking should be thorough and so it's fine if it's very long.\n"
)
@@ -80,7 +80,7 @@ IPythonTool = ChatCompletionToolParam(
),
)
_FILE_EDIT_DESCRIPTION = """Edit a file in plain-text format.
_FILE_EDIT_DESCRIPTION = """Edit a file.
* The assistant can edit files by specifying the file path and providing a draft of the new file content.
* The draft content doesn't need to be exactly the same as the existing file; the assistant may skip unchanged lines using comments like `# unchanged` to indicate unchanged sections.
* IMPORTANT: For large files (e.g., > 300 lines), specify the range of lines to edit using `start` and `end` (1-indexed, inclusive). The range should be smaller than 300 lines.
@@ -216,7 +216,7 @@ LLMBasedFileEditTool = ChatCompletionToolParam(
),
)
_STR_REPLACE_EDITOR_DESCRIPTION = """Custom editing tool for viewing, creating and editing files in plain-text format
_STR_REPLACE_EDITOR_DESCRIPTION = """Custom editing tool for viewing, creating and editing files
* State is persistent across command calls and discussions with the user
* If `path` is a file, `view` displays the result of applying `cat -n`. If `path` is a directory, `view` lists non-hidden files and directories up to 2 levels deep
* The `create` command cannot be used if the specified `path` already exists as a file