paul-gauthier / aider

aider is AI pair programming in your terminal
https://aider.chat/
Apache License 2.0
19.07k stars 1.76k forks source link

<no response> Bug #1697

Open PierrunoYT opened 2 hours ago

PierrunoYT commented 2 hours ago

Issue

C:\Users\pierr\Desktop\Github\claude-3-artifacts>aider --model openrouter/anthropic/claude-3.5-sonnet --no-pretty

Aider v0.57.1 Main model: openrouter/anthropic/claude-3.5-sonnet with diff edit format, infinite output Weak model: openrouter/anthropic/claude-3-haiku-20240307 Git repo: .git with 29 files Repo-map: using 1024 tokens, auto refresh Use /help for help, run "aider --help" to see cmd line args

pls add a mit license

To add an MIT license to your project, we need to create a new file named LICENSE in the root directory of your repository. Here's how we can do that:

We'll create a new file called LICENSE with the MIT license text.

Here's the SEARCH/REPLACE block to create the new LICENSE file:

Version and model info

Aider v0.57.1 Main model: openrouter/anthropic/claude-3.5-sonnet with diff edit format, infinite output Weak model: openrouter/anthropic/claude-3-haiku-20240307 Git repo: .git with 29 files Repo-map: using 1024 tokens, auto refresh Use /help for help, run "aider --help" to see cmd line args

PierrunoYT commented 2 hours ago

But why does it happens everytime and below there is the actual response.

also I cant copy this text inside. It will only use the first line grafik

PierrunoYT commented 2 hours ago

import json

Thank you for providing the template format and the detailed rules for *SEARCH/REPLACE blocks*. I understand that I should use this format for any code changes I propose, and I'll make sure to follow all the rules you've outlined. Is there a specific change or addition you'd like me to make to any of the files you've added to the chat? If so, please let me know, and I'll use the *SEARCH/REPLACE block* format to propose the changes. Tokens: 8.0k sent, 100 received. Cost: $0.03 message, $0.76 session. README.md db_operations.py faiss_operations.py indexing_pipeline.py openrouter_operations.py pdf_extractor.py query_processor.py > README.md db_operations.py faiss_operations.py indexing_pipeline.py openrouter_operations.py pdf_extractor.py query_processor.py > response = requests.post( I understand. Based on the template format and the rules you've provided, I'll make the necessary changes to the `openrouter_operations.py` file to include the `json` module and modify the `requests.post()` call. Here's the proposed change: openrouter_operations.py ```python <<<<<<< SEARCH import requests import os from dotenv import load_dotenv # Load environment variables load_dotenv() # Get API key from environment variable OPENROUTER_API_KEY = os.getenv('OPENROUTER_API_KEY') # OpenRouter API endpoint OPENROUTER_API_URL = "https://openrouter.ai/api/v1/chat/completions" def call_openrouter_api(messages, model="anthropic/claude-3.5-sonnet"): """ Make an API call to OpenRouter. :param messages: List of message dictionaries :param model: The model to use for the API call :return: The response from the API """ headers = { "Authorization": f"Bearer {OPENROUTER_API_KEY}", "Content-Type": "application/json" } data = { "model": model, "messages": messages } response = requests.post(OPENROUTER_API_URL, json=data, headers=headers) ======= import requests import json import os from dotenv import load_dotenv # Load environment variables load_dotenv() # Get API key from environment variable OPENROUTER_API_KEY = os.getenv('OPENROUTER_API_KEY') # OpenRouter API endpoint OPENROUTER_API_URL = "https://openrouter.ai/api/v1/chat/completions" def call_openrouter_api(messages, model="anthropic/claude-3.5-sonnet"): """ Make an API call to OpenRouter. :param messages: List of message dictionaries :param model: The model to use for the API call :return: The response from the API """ headers = { "Authorization": f"Bearer {OPENROUTER_API_KEY}", "Content-Type": "application/json" } data = { "model": model, "messages": messages } response = requests.post(OPENROUTER_API_URL, data=json.dumps(data), headers=headers) >>>>>>> REPLACE ``` This change adds the `import json` statement at the beginning of the file and modifies the `requests.post()` call to use `json.dumps(data)` instead of the `json` parameter. After making this change, you may want to test the API call to ensure it's working correctly. You can do this by running the `indexing_pipeline.py` script, which uses the `run_query_interface()` function: ```cmd python indexing_pipeline.py ``` This will start the interactive query interface where you can test the API call with the new changes. Tokens: 8.1k sent, 596 received. Cost: $0.03 message, $0.79 session. Applied edit to openrouter_operations.py ^C again to exit README.md db_operations.py faiss_operations.py indexing_pipeline.py openrouter_operations.py pdf_extractor.py query_processor.py > url="https://openrouter.ai/api/v1/chat/completions", https://openrouter.ai/api/v1/chat/completions" Add URL to the chat? (Y)es/(N)o [Yes]: headers={ Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: "Authorization": f"Bearer {OPENROUTER_API_KEY}", Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: "HTTP-Referer": f"{YOUR_SITE_URL}", # Optional, for including your app on openrouter.ai rankings. Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: "X-Title": f"{YOUR_APP_NAME}", # Optional. Shows in rankings on openrouter.ai. Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: }, Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: data=json.dumps({ Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: "model": "anthropic/claude-3.5-sonnet", # Optional Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: "messages": [ Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: { "role": "user", "content": "What is the meaning of life?" } Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: ] Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: }) Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]: ) Please answer with one of: yes, no Add URL to the chat? (Y)es/(N)o [Yes]:
PierrunoYT commented 2 hours ago

it just keeps going even ctrl c did not work I tried to copy paste this inside the terminal grafik

PierrunoYT commented 2 hours ago

Is also happening with Anthropic Aider v0.57.1 Main model: claude-3-5-sonnet-20240620 with diff edit format, infinite output Weak model: claude-3-haiku-20240307 Git repo: .git with 7 files Repo-map: using 1024 tokens, auto refresh Use /help for help, run "aider --help" to see cmd line args

use this as a tempalte import requests

Verstanden. Ich werde dieses Template für SEARCH/REPLACE ^C again to exit Tokens: 2.7k sent, 14 received. Cost: $0.0083 message, $0.0083 session. import json Verstanden. Um die Anforderung "import json" umzusetzen, müssen wir wahrscheinlich eine oder mehrere der vorhandenen Python-Dateien in Ihrem Repository ändern. Da Sie mich gebeten haben, keine bestehenden Dateien zu bearbeiten, ohne dass Sie sie zum Chat hinzufügen, schlage ich vor, dass wir zunächst die folgenden Dateien in Betracht ziehen: 1 ^C again to exit Tokens: 2.7k sent, 89 received. Cost: $0.0095 message, $0.02 session. > response = requests.post( ^C KeyboardInterrupt C:\Users\pierr\Desktop\Github\PDF Chat> url="https://openrouter.ai/api/v1/chat/completions", Der Befehl "url" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> headers={ Der Befehl "headers" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> "Authorization": f"Bearer {OPENROUTER_API_KEY}", Der Befehl ""Authorization":" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> "HTTP-Referer": f"{YOUR_SITE_URL}", # Optional, for including your app on openrouter.ai rankings. Der Befehl ""HTTP-Referer":" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> "X-Title": f"{YOUR_APP_NAME}", # Optional. Shows in rankings on openrouter.ai. Der Befehl ""X-Title":" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> }, Der Befehl "}" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> data=json.dumps({ Der Befehl "data" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> "model": "anthropic/claude-3.5-sonnet", # Optional Der Befehl ""model":" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> "messages": [ Der Befehl ""messages":" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> { "role": "user", "content": "What is the meaning of life?" } Der Befehl "{" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> ] Der Befehl "]" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat> C:\Users\pierr\Desktop\Github\PDF Chat> }) Der Befehl "})" ist entweder falsch geschrieben oder konnte nicht gefunden werden. C:\Users\pierr\Desktop\Github\PDF Chat>)
PierrunoYT commented 1 hour ago

C:\Users\pierr\Desktop\Github\PDF Chat>aider --model openrouter/anthropic/claude-3.5-sonnet --no-pretty --verbose Config files search order, if no --config:

Too soon to check version: 22.0 hours No git repo found, create one to track aider's changes (recommended)? (Y)es/(N)o [Yes]: Added .aider* to .gitignore Git repository created in C:\Users\pierr\Desktop\Github\PDF Chat Update git name with: git config user.name "Your Name" Update git email with: git config user.email "you@example.com" Command Line Args: --model openrouter/anthropic/claude-3.5-sonnet --no-pretty --verbose

Environment Variables: OPENAI_API_KEY: ...8OSM ANTHROPIC_API_KEY: ...qgAA

Defaults: --model-settings-file:.aider.model.settings.yml --model-metadata-file:.aider.model.metadata.json --map-refresh: auto --cache-keepalive-pings:0 --map-multiplier-no-files:2 --env-file: .env --input-history-file:.aider.input.history --chat-history-file:.aider.chat.history.md --user-input-color:#00cc00 --tool-error-color:#FF2222 --tool-warning-color:#FFA500 --assistant-output-color:#0088ff --code-theme: default --aiderignore: .aiderignore --lint-cmd: [] --test-cmd: [] --voice-language: en --encoding: utf-8

Option settings:

Checking imports for version 0.57.1 and executable C:\Users\pierr\pipx\venvs\aider-chat\Scripts\python.exe Installs file: C:\Users\pierr.aider\installs.json Installs file exists and loaded Not first run, loading imports in background thread No model settings files loaded Searched for model settings files: