update PR
Browse filesFiles changed (2)
1399 unmodified lines1400140114021403140414051406140714081409141014111412141314141415141614171399 unmodified linesfile_path.write_text(content, encoding='utf-8')# Create PR using the correct API flow:# 1. Create discussion with pull_request=True# 2. Add commits to the PR branchtry:print(f"[PR] Creating pull request on {repo_id}")# Step 1: Create the PR (draft mode)discussion = api.create_discussion(repo_id=repo_id,title=pr_title,description=pr_description,repo_type="space",pull_request=True, # This makes it a PR instead of discussiontoken=token)1399 unmodified lines140014011402140314041405140614071408140914101411141214131414141514161399 unmodified linesfile_path.write_text(content, encoding='utf-8')# Create PR using the correct API flow:# 1. Create PR with create_pull_request()# 2. Add commits to the PR branchtry:print(f"[PR] Creating pull request on {repo_id}")# Step 1: Create the PR (draft mode) using the wrapper functiondiscussion = api.create_pull_request(repo_id=repo_id,title=pr_title,description=pr_description,repo_type="space",token=token)
237 unmodified lines23823924024124224324456 unmodified lines301302303304305306307481 unmodified lines789790791792793794795237 unmodified lines}};const handleSendMessage = async (message: string, overrideLanguage?: Language, overrideModel?: string, overrideRepoId?: string) => {if (!isAuthenticated) {alert('Please sign in with HuggingFace first! Click the "Sign in with Hugging Face" button in the header.');return;56 unmodified lineshistory: messages.map((m) => [m.role, m.content]),agent_mode: false,existing_repo_id: effectiveRepoId, // Pass duplicated/imported space ID for auto-deployskip_auto_deploy: !!pendingPR, // Skip auto-deploy if PR is pending};const assistantMessage: Message = {481 unmodified lines// Send the message with the selected language and model// Don't pass repoId to handleSendMessage when creating PR (we want to generate code first, then create PR)await handleSendMessage(prompt, language, modelId, shouldCreatePR ? undefined : repoId);};// Resize handlers for chat sidebar (desktop only)237 unmodified lines23823924024124224324456 unmodified lines301302303304305306307481 unmodified lines789790791792793794795237 unmodified lines}};const handleSendMessage = async (message: string, overrideLanguage?: Language, overrideModel?: string, overrideRepoId?: string, shouldCreatePR?: boolean) => {if (!isAuthenticated) {alert('Please sign in with HuggingFace first! Click the "Sign in with Hugging Face" button in the header.');return;56 unmodified lineshistory: messages.map((m) => [m.role, m.content]),agent_mode: false,existing_repo_id: effectiveRepoId, // Pass duplicated/imported space ID for auto-deployskip_auto_deploy: !!shouldCreatePR, // Skip auto-deploy if creating PR};const assistantMessage: Message = {481 unmodified lines// Send the message with the selected language and model// Don't pass repoId to handleSendMessage when creating PR (we want to generate code first, then create PR)await handleSendMessage(prompt, language, modelId, shouldCreatePR ? undefined : repoId, shouldCreatePR);};// Resize handlers for chat sidebar (desktop only)
backend_deploy.py+3-4
frontend/src/app/page.tsx+3-3