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

Sweep: rename user-facing text containing "Discourse" to "community forum" #3743

Closed
2 tasks
kevinlu1248 opened this issue May 15, 2024 · 2 comments · Fixed by #3748
Closed
2 tasks

Sweep: rename user-facing text containing "Discourse" to "community forum" #3743

kevinlu1248 opened this issue May 15, 2024 · 2 comments · Fixed by #3748
Labels
sweep Assigns Sweep to an issue or pull request.

Comments

@kevinlu1248
Copy link
Member

kevinlu1248 commented May 15, 2024

Checklist
  • sweep_chat/components/ui/switch.tsx
  • sweep_chat/backend/api.py
@kevinlu1248 kevinlu1248 added the sweep Assigns Sweep to an issue or pull request. label May 15, 2024
@kevinlu1248 kevinlu1248 changed the title Sweep: rename user-facing text containing "Discourse" to "Community forum" Sweep: rename user-facing text containing "Discourse" to "community forum" May 15, 2024
@sweepai sweepai deleted a comment from sweep-nightly bot May 15, 2024
@sweepai sweepai deleted a comment from sweep-nightly bot May 15, 2024
kevinlu1248 added a commit that referenced this issue May 15, 2024
…orum" (#3748)

# Description
This pull request corrects a typo in the `search_agent.py` file within
the `sweepai/agents` directory, improving the clarity of the
documentation. The typo correction changes "investagate" to
"investigate" in the guidelines for describing code changes.

# Summary
- Corrected a typo in the `search_agent.py` file to enhance
documentation clarity.
- Changed "investagate" to "investigate" in the instructions for
detailing code modifications.

Fixes #3743.

---

<details>
<summary><b>🎉 Latest improvements to Sweep:</b></summary>
<ul>
<li>New <a href="https://sweep-trilogy.vercel.app">dashboard</a>
launched for real-time tracking of Sweep issues, covering all stages
from search to coding.</li>
<li>Integration of OpenAI's latest Assistant API for more efficient and
reliable code planning and editing, improving speed by 3x.</li>
<li>Use the <a
href="https://marketplace.visualstudio.com/items?itemName=GitHub.vscode-pull-request-github">GitHub
issues extension</a> for creating Sweep issues directly from your
editor.</li>
</ul>
</details>


---

### 💡 To get Sweep to edit this pull request, you can:
* Comment below, and Sweep can edit the entire PR
* Comment on a file, Sweep will only modify the commented file
* Edit the original issue to get Sweep to recreate the PR from scratch

*This is an automated message generated by [Sweep
AI](https://sweep.dev).*
@kevinlu1248 kevinlu1248 reopened this May 15, 2024
@sweepai sweepai deleted a comment from sweep-nightly bot May 15, 2024
@kevinlu1248 kevinlu1248 added sweep Assigns Sweep to an issue or pull request. and removed sweep Assigns Sweep to an issue or pull request. labels May 15, 2024
@sweepai sweepai deleted a comment from sweep-nightly bot May 15, 2024
@kevinlu1248 kevinlu1248 added sweep Assigns Sweep to an issue or pull request. and removed sweep Assigns Sweep to an issue or pull request. labels May 15, 2024
@sweepai sweepai deleted a comment from sweep-nightly bot May 15, 2024
@kevinlu1248 kevinlu1248 added sweep Assigns Sweep to an issue or pull request. and removed sweep Assigns Sweep to an issue or pull request. labels May 15, 2024
Copy link
Contributor

sweep-nightly bot commented May 15, 2024

Sweeping

25%


Actions (click)

  • ↻ Restart Sweep

❌ Unable to Complete PR

I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is 422 {"message": "Invalid tree info", "documentation_url": "https://docs.github.com/rest/git/trees#create-a-tree"}. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.

For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: fdb08e6133).


Please look at the generated plan. If something looks wrong, please add more details to your issue.

File Path Proposed Changes
sweep_chat/components/ui/switch.tsx Modify sweep_chat/components/ui/switch.tsx with contents:
Instructions: Search this file for any user-facing text containing "Discourse" and replace it with "community forum".

<original_code>
"use client"

import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch"

import { cn } from "@/lib/utils"

const Switch = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
))
Switch.displayName = SwitchPrimitives.Root.displayName

export { Switch }
</original_code>

<new_code>
"use client"

import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch"

import { cn } from "@/lib/utils"

const Switch = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
))
Switch.displayName = SwitchPrimitives.Root.displayName

export { Switch }
</new_code>
sweep_chat/backend/api.py Modify sweep_chat/backend/api.py with contents:
Instructions: Search this file for any user-facing text containing "Discourse" and replace it with "community forum".

<original_code>
import json
import os
from fastapi import Body, FastAPI
from fastapi.responses import StreamingResponse
import git

from sweepai.agents.modify_utils import validate_and_parse_function_call
from sweepai.agents.search_agent import extract_xml_tag
from sweepai.core.chat import ChatGPT
from sweepai.core.entities import Message, Snippet
from sweepai.utils.convert_openai_anthropic import AnthropicFunctionCall
from sweepai.utils.github_utils import ClonedRepo, MockClonedRepo
from sweepai.utils.ticket_utils import prep_snippets

app = FastAPI()

@app.get("/repo")
def check_repo_exists(repo_name: str):
org_name, repo = repo_name.split("/")
if os.path.exists(f"/tmp/{repo}"):
return {"success": True}
try:
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
return {"success": True}
except Exception as e:
return {"success": False, "error": str(e)}

def search_codebase(
repo_name: str,
query: str
):
org_name, repo = repo_name.split("/")
if not os.path.exists(f"/tmp/{repo}"):
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
cloned_repo = MockClonedRepo(f"/tmp/{repo}", repo_name)
repo_context_manager = prep_snippets(cloned_repo, query, use_multi_query=False, NUM_SNIPPETS_TO_KEEP=0)
return repo_context_manager.current_top_snippets

@app.get("/search")
def search_codebase_endpoint(
repo_name: str,
query: str
):
return [snippet.model_dump() for snippet in search_codebase(repo_name, query)]

example_tool_calls = """Here is an illustrative example of how to use the tools:

To ask questions about the codebase:
<function_call>

<tool_name>search_codebase</tool_name>


How do we the user-provided password hash against the stored hash from the database in the user-authentication service?



</function_call>

Notice that the query parameter is a single, extremely detailed, specific natural language search question.

Here are other examples of good questions to ask:

How are GraphQL mutations constructed for updating a user's profile information, and what specific fields are being updated?
How do the current React components render the product carousel on the homepage, and what library is being used for the carousel functionality?
How do we currently implement the endpoint handler for processing incoming webhook events from Stripe in the backend API, and how are the events being validated and parsed?
What is the structure of the Post model in the blog module?

The above are just illustrative examples. Make sure to provide detailed, specific questions to search for relevant snippets in the codebase and only make one function call."""

</original_code>

<new_code>
import json
import os
from fastapi import Body, FastAPI
from fastapi.responses import StreamingResponse
import git

from sweepai.agents.modify_utils import validate_and_parse_function_call
from sweepai.agents.search_agent import extract_xml_tag
from sweepai.core.chat import ChatGPT
from sweepai.core.entities import Message, Snippet
from sweepai.utils.convert_openai_anthropic import AnthropicFunctionCall
from sweepai.utils.github_utils import ClonedRepo, MockClonedRepo
from sweepai.utils.ticket_utils import prep_snippets

app = FastAPI()

@app.get("/repo")
def check_repo_exists(repo_name: str):
org_name, repo = repo_name.split("/")
if os.path.exists(f"/tmp/{repo}"):
return {"success": True}
try:
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
return {"success": True}
except Exception as e:
return {"success": False, "error": str(e)}

def search_codebase(
repo_name: str,
query: str
):
org_name, repo = repo_name.split("/")
if not os.path.exists(f"/tmp/{repo}"):
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
cloned_repo = MockClonedRepo(f"/tmp/{repo}", repo_name)
repo_context_manager = prep_snippets(cloned_repo, query, use_multi_query=False, NUM_SNIPPETS_TO_KEEP=0)
return repo_context_manager.current_top_snippets

@app.get("/search")
def search_codebase_endpoint(
repo_name: str,
query: str
):
return [snippet.model_dump() for snippet in search_codebase(repo_name, query)]

example_tool_calls = """Here is an illustrative example of how to use the tools:

To ask questions about the codebase:
<function_call>

<tool_name>search_codebase</tool_name>


How do we the user-provided password hash against the stored hash from the database in the user-authentication service?



</function_call>

Notice that the query parameter is a single, extremely detailed, specific natural language search question.

Here are other examples of good questions to ask:

How are GraphQL mutations constructed for updating a user's profile information, and what specific fields are being updated?
How do the current React components render the product carousel on the homepage, and what library is being used for the carousel functionality?
How do we currently implement the endpoint handler for processing incoming webhook events from Stripe in the backend API, and how are the events being validated and parsed?
What is the structure of the Post model in the blog module?

The above are just illustrative examples. Make sure to provide detailed, specific questions to search for relevant snippets in the codebase and only make one function call."""

</new_code>

🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description.

This is an automated message generated by Sweep AI.

@kevinlu1248 kevinlu1248 added sweep Assigns Sweep to an issue or pull request. and removed sweep Assigns Sweep to an issue or pull request. labels May 15, 2024
Copy link
Contributor

sweep-nightly bot commented May 15, 2024

Sweeping

25%


Actions (click)

  • ↻ Restart Sweep

❌ Unable to Complete PR

I'm sorry, but it looks like an error has occurred due to a planning failure. The error message is 422 {"message": "Invalid tree info", "documentation_url": "https://docs.github.com/rest/git/trees#create-a-tree"}. Feel free to add more details to the issue description so Sweep can better address it. Alternatively, reach out to Kevin or William for help at https://community.sweep.dev/.

For bonus GPT-4 tickets, please report this bug on Discourse (tracking ID: 2b819aa413).


Please look at the generated plan. If something looks wrong, please add more details to your issue.

File Path Proposed Changes
sweep_chat/components/ui/switch.tsx Modify sweep_chat/components/ui/switch.tsx with contents:
Instructions: Search this file for any user-facing text containing "Discourse" and replace it with "community forum".

<original_code>
"use client"

import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch"

import { cn } from "@/lib/utils"

const Switch = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
))
Switch.displayName = SwitchPrimitives.Root.displayName

export { Switch }
</original_code>

<new_code>
"use client"

import * as React from "react"
import * as SwitchPrimitives from "@radix-ui/react-switch"

import { cn } from "@/lib/utils"

const Switch = React.forwardRef<
React.ElementRef,
React.ComponentPropsWithoutRef
>(({ className, ...props }, ref) => (
<SwitchPrimitives.Root
className={cn(
"peer inline-flex h-6 w-11 shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50 data-[state=checked]:bg-primary data-[state=unchecked]:bg-input",
className
)}
{...props}
ref={ref}
>
<SwitchPrimitives.Thumb
className={cn(
"pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform data-[state=checked]:translate-x-5 data-[state=unchecked]:translate-x-0"
)}
/>
</SwitchPrimitives.Root>
))
Switch.displayName = SwitchPrimitives.Root.displayName

export { Switch }
</new_code>
sweep_chat/backend/api.py Modify sweep_chat/backend/api.py with contents:
Instructions: Search this file for any user-facing text containing "Discourse" and replace it with "community forum".

<original_code>
import json
import os
from fastapi import Body, FastAPI
from fastapi.responses import StreamingResponse
import git

from sweepai.agents.modify_utils import validate_and_parse_function_call
from sweepai.agents.search_agent import extract_xml_tag
from sweepai.core.chat import ChatGPT
from sweepai.core.entities import Message, Snippet
from sweepai.utils.convert_openai_anthropic import AnthropicFunctionCall
from sweepai.utils.github_utils import ClonedRepo, MockClonedRepo
from sweepai.utils.ticket_utils import prep_snippets

app = FastAPI()

@app.get("/repo")
def check_repo_exists(repo_name: str):
org_name, repo = repo_name.split("/")
if os.path.exists(f"/tmp/{repo}"):
return {"success": True}
try:
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
return {"success": True}
except Exception as e:
return {"success": False, "error": str(e)}

def search_codebase(
repo_name: str,
query: str
):
org_name, repo = repo_name.split("/")
if not os.path.exists(f"/tmp/{repo}"):
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
cloned_repo = MockClonedRepo(f"/tmp/{repo}", repo_name)
repo_context_manager = prep_snippets(cloned_repo, query, use_multi_query=False, NUM_SNIPPETS_TO_KEEP=0)
return repo_context_manager.current_top_snippets

@app.get("/search")
def search_codebase_endpoint(
repo_name: str,
query: str
):
return [snippet.model_dump() for snippet in search_codebase(repo_name, query)]

example_tool_calls = """Here is an illustrative example of how to use the tools:

To ask questions about the codebase:
<function_call>

<tool_name>search_codebase</tool_name>


How do we the user-provided password hash against the stored hash from the database in the user-authentication service?



</function_call>

Notice that the query parameter is a single, extremely detailed, specific natural language search question.

Here are other examples of good questions to ask:

How are GraphQL mutations constructed for updating a user's profile information, and what specific fields are being updated?
How do the current React components render the product carousel on the homepage, and what library is being used for the carousel functionality?
How do we currently implement the endpoint handler for processing incoming webhook events from Stripe in the backend API, and how are the events being validated and parsed?
What is the structure of the Post model in the blog module?

The above are just illustrative examples. Make sure to provide detailed, specific questions to search for relevant snippets in the codebase and only make one function call."""

</original_code>

<new_code>
import json
import os
from fastapi import Body, FastAPI
from fastapi.responses import StreamingResponse
import git

from sweepai.agents.modify_utils import validate_and_parse_function_call
from sweepai.agents.search_agent import extract_xml_tag
from sweepai.core.chat import ChatGPT
from sweepai.core.entities import Message, Snippet
from sweepai.utils.convert_openai_anthropic import AnthropicFunctionCall
from sweepai.utils.github_utils import ClonedRepo, MockClonedRepo
from sweepai.utils.ticket_utils import prep_snippets

app = FastAPI()

@app.get("/repo")
def check_repo_exists(repo_name: str):
org_name, repo = repo_name.split("/")
if os.path.exists(f"/tmp/{repo}"):
return {"success": True}
try:
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
return {"success": True}
except Exception as e:
return {"success": False, "error": str(e)}

def search_codebase(
repo_name: str,
query: str
):
org_name, repo = repo_name.split("/")
if not os.path.exists(f"/tmp/{repo}"):
git.clone(f"https://github.com/{repo_name}", f"/tmp/{repo}")
cloned_repo = MockClonedRepo(f"/tmp/{repo}", repo_name)
repo_context_manager = prep_snippets(cloned_repo, query, use_multi_query=False, NUM_SNIPPETS_TO_KEEP=0)
return repo_context_manager.current_top_snippets

@app.get("/search")
def search_codebase_endpoint(
repo_name: str,
query: str
):
return [snippet.model_dump() for snippet in search_codebase(repo_name, query)]

example_tool_calls = """Here is an illustrative example of how to use the tools:

To ask questions about the codebase:
<function_call>

<tool_name>search_codebase</tool_name>


How do we the user-provided password hash against the stored hash from the database in the user-authentication service?



</function_call>

Notice that the query parameter is a single, extremely detailed, specific natural language search question.

Here are other examples of good questions to ask:

How are GraphQL mutations constructed for updating a user's profile information, and what specific fields are being updated?
How do the current React components render the product carousel on the homepage, and what library is being used for the carousel functionality?
How do we currently implement the endpoint handler for processing incoming webhook events from Stripe in the backend API, and how are the events being validated and parsed?
What is the structure of the Post model in the blog module?

The above are just illustrative examples. Make sure to provide detailed, specific questions to search for relevant snippets in the codebase and only make one function call."""

</new_code>

🎉 Latest improvements to Sweep:
  • New dashboard launched for real-time tracking of Sweep issues, covering all stages from search to coding.
  • Integration of OpenAI's latest Assistant API for more efficient and reliable code planning and editing, improving speed by 3x.
  • Use the GitHub issues extension for creating Sweep issues directly from your editor.

💡 To recreate the pull request edit the issue title or description.

This is an automated message generated by Sweep AI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
sweep Assigns Sweep to an issue or pull request.
Projects
None yet
1 participant