MetaGPT icon indicating copy to clipboard operation
MetaGPT copied to clipboard

Not able to run any MetaGPT examples

Open amd-srautmar opened this issue 1 year ago • 2 comments

Referred Issue #1322 , but not able to resolve the issue. I added azure based api endpoint and api key in config2.yaml

│ 105 │ │ typer.echo("Missing argument 'IDEA'. Run 'metagpt --help' for more information." │ │ 106 │ │ raise typer.Exit() │ │ 107 │ │ │ ❱ 108 │ return generate_repo( │ │ 109 │ │ idea, │ │ 110 │ │ investment, │ │ 111 │ │ n_round, │ │ │ \metagpt\software_company.py:30 in generate_repo │ │ │ │ 27 │ recover_path=None, │ │ 28 ) -> ProjectRepo: │ │ 29 │ """Run the startup logic. Can be called from CLI or other Python scripts.""" │ │ ❱ 30 │ from metagpt.config2 import config │ │ 31 │ from metagpt.context import Context │ │ 32 │ from metagpt.roles import ( │ │ 33 │ │ Architect, │ │ │ \new_meta_env\Lib\site-packages\metagpt-0.8.1-py3.11.egg\metagpt\ │ │ config2.py:164 in │ │ │ │ 161 │ return result │ │ 162 │ │ 163 │ │ ❱ 164 config = Config.default() │ \new_meta_env\Lib\site-packages\metagpt-0.8.1-py3.11.egg\metagpt\ │ │ config2.py:106 in default │ │ │ │ 103 │ │ dicts = [dict(os.environ)] │ │ 104 │ │ dicts += [Config.read_yaml(path) for path in default_config_paths] │ │ 105 │ │ final = merge_dict(dicts) │ │ ❱ 106 │ │ return Config(**final) │ │ 107 │ │ │ 108 │ @classmethod │ │ 109 │ def from_llm_config(cls, llm_config: dict): │ │ │ \new_meta_env\Lib\site-packages\pydantic\main.py:176 in init │ │ │ │ 173 │ │ """ │ │ 174 │ │ # __tracebackhide__ tells pytest and some other tools to omit this function fr │ │ 175 │ │ tracebackhide = True │ │ ❱ 176 │ │ self.pydantic_validator.validate_python(data, self_instance=self) │ │ 177 │ │ │ 178 │ # The following line sets a flag that we use to determine when __init__ gets overr │ │ 179 │ init.pydantic_base_init = True # pyright: ignore[reportFunctionMemberAccess │ ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯ ValidationError: 1 validation error for Config llm Field required [type=missing, input_value={'ALLUSERSPROFILE': 'C:\..._INIT_AT_FORK': 'FALSE'}, input_type=dict] For further information visit https://errors.pydantic.dev/2.7/v/missing

amd-srautmar avatar Jun 13 '24 10:06 amd-srautmar

Updated ~/.metagpt/config2.yaml , and earlier issue is resolved. But new issue is there with missing subscription key.

this is my config2.yaml llm: api_type: "azure" # or azure / ollama / groq etc. model: "gpt-3.5-turbo" # or gpt-3.5-turbo base_url: "llm url" # or forward url / other llm url api_key: key

2024-06-13 11:28:25.212 | INFO | metagpt.actions.write_prd:run:86 - New requirement detected: Write a cli snake game based on pygame 2024-06-13 11:28:26.161 | ERROR | metagpt.utils.common:log_it:554 - Finished call to 'metagpt.actions.action_node.ActionNode._aask_v1' after 0.937(s), this was the 1st time calling it. exp: Error code: 401 - {'statusCode': 401, 'message': 'Access denied due to missing subscription key. Make sure to include subscription key when making requests to an API.'}

amd-srautmar avatar Jun 13 '24 10:06 amd-srautmar

Looks like there are some configuration errors with base_url or api_key. You can refer to: https://learn.microsoft.com/en-us/troubleshoot/azure/api-mgmt/availability/unauthorized-errors-invoke-apis

voidking avatar Jul 18 '24 06:07 voidking

Due to the lack of updates or replies by the user for a long time, we will close it. Please reopen it if necessary.

better629 avatar Oct 09 '24 17:10 better629