princeton-nlp / SWE-agent

SWE-agent takes a GitHub issue and tries to automatically fix it, using GPT-4, or your LM of choice. It can also be employed for offensive cybersecurity or competitive coding challenges.
https://princeton-nlp.github.io/SWE-agent/
MIT License
13.39k stars 1.32k forks source link

OPENAI_API_BASE_URL with port - semi colon issue #569

Closed shuther closed 3 months ago

shuther commented 3 months ago

Describe the bug

in the keys.cfg file, the line below is not supported: OPENAI_API_BASE_URL:http://192.168.0.120:4000

Steps/commands/code to Reproduce

OPENAI_API_BASE_URL:http://192.168.0.120:4000

Error message/results

app-1     | During handling of the above exception, another exception occurred:
app-1     |
app-1     | Traceback (most recent call last):
app-1     |   File "/app/sweagent/utils/config.py", line 45, in __init__
app-1     |     self._keys_cfg = config_file.Config(str(keys_cfg_path))
app-1     |   File "/usr/local/lib/python3.9/site-packages/config/__init__.py", line 707, in __init__
app-1     |     self.load_file(stream_or_path, kwargs.get('encoding'))
app-1     |   File "/usr/local/lib/python3.9/site-packages/config/__init__.py", line 816, in load_file
app-1     |     self.load(f)
app-1     |   File "/usr/local/lib/python3.9/site-packages/config/__init__.py", line 807, in load
app-1     |     raise cfe
app-1     | config.ConfigFormatError: Unexpected ':' at (2, 25)
app-1     |
app-1     | The above exception was the direct cause of the following exception:
app-1     |
app-1     | Traceback (most recent call last):
app-1     |   File "/app/run.py", line 44, in <module>
app-1     |     from sweagent.agent.agents import Agent, AgentArguments
app-1     |   File "/app/sweagent/agent/agents.py", line 16, in <module>
app-1     |     from sweagent.agent.models import (
app-1     |   File "/app/sweagent/agent/models.py", line 22, in <module>
app-1     |     from sweagent.utils.config import keys_config
app-1     |   File "/app/sweagent/utils/config.py", line 85, in <module>
app-1     |     keys_config = Config()
app-1     |   File "/app/sweagent/utils/config.py", line 48, in __init__
app-1     |     raise RuntimeError(msg) from e
app-1     | RuntimeError: Error loading keys.cfg from /app/keys.cfg. Please check the file.

System Information

ubuntu with dockers

Checklist

klieret commented 3 months ago

I believe you're missing the quotation marks around the URL. lmk if that doesn't help

shuther commented 3 months ago

yes, I missed it, maybe also with a space before?. we can close the case I guess.