mirror of
https://github.com/FoundationAgents/MetaGPT.git
synced 2026-04-28 18:36:22 +02:00
add gemini minimal python version warning
This commit is contained in:
parent
f3eb9f638e
commit
bdb427d5b7
3 changed files with 14 additions and 3 deletions
|
|
@ -19,6 +19,7 @@ import json
|
|||
import os
|
||||
import platform
|
||||
import re
|
||||
import sys
|
||||
import traceback
|
||||
import typing
|
||||
from pathlib import Path
|
||||
|
|
@ -47,6 +48,12 @@ def check_cmd_exists(command) -> int:
|
|||
return result
|
||||
|
||||
|
||||
def require_python_version(req_version: tuple[int]) -> bool:
|
||||
if not (2 <= len(req_version) <= 3):
|
||||
raise ValueError("req_version should be (3, 9) or (3, 10, 13)")
|
||||
return True if sys.version_info > req_version else False
|
||||
|
||||
|
||||
class OutputParser:
|
||||
@classmethod
|
||||
def parse_blocks(cls, text: str):
|
||||
|
|
@ -219,7 +226,7 @@ class OutputParser:
|
|||
|
||||
if start_index != -1 and end_index != -1:
|
||||
# Extract the structure part
|
||||
structure_text = text[start_index : end_index + 1]
|
||||
structure_text = text[start_index: end_index + 1]
|
||||
|
||||
try:
|
||||
# Attempt to convert the text to a Python data type using ast.literal_eval
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue