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

feat: fix JSONDecodeError error caused by incorrect indentation used … #963

Merged
merged 1 commit into from
Mar 7, 2024

Conversation

moyitech
Copy link
Contributor

@moyitech moyitech commented Mar 5, 2024

Features

Issue: #733
c57e4e482e5c370d78e525e50867bc6

We often encounter this issue when using ZHIPU AI instead of OpenAI
Although the repair_llm.output option is enabled in the configuration file, the JSON correction function cannot be used.

Feature Docs
By reading config2. py, I learned that the repair_llm output option in config2. yaml should be placed in the first level indentation instead of under llm, so I modified config2. example. yaml

Result
db78db8aec4898731bfd31f715ca1a2

…in repair_llm.output in config2.example.yaml
@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 80.69%. Comparing base (5cae13f) to head (8239a11).

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@           Coverage Diff           @@
##             main     #963   +/-   ##
=======================================
  Coverage   80.69%   80.69%           
=======================================
  Files         226      226           
  Lines       13178    13178           
=======================================
  Hits        10634    10634           
  Misses       2544     2544           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@iorisa
Copy link
Collaborator

iorisa commented Mar 7, 2024

Good job.

class Config(CLIParams, YamlModel):
    """Configurations for MetaGPT"""

    # Key Parameters
    llm: LLMConfig

    ...

    # Misc Parameters
    repair_llm_output: bool = False

@iorisa iorisa merged commit 01d40e0 into geekan:main Mar 7, 2024
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants