Error lab: 'converter.py' exited with a non-zero status code: 1

Hello, I’m trying to validate the lab, but I’m getting the following error:

‘converter.py’ exited with a non-zero status code: 1

And this is the code I implemented:

from openai import OpenAI
import os

# Crear cliente OpenAI usando variables del entorno
client = OpenAI(
    api_key=os.getenv("OPENAI_API_KEY"),
    base_url=os.getenv("OPENAI_API_BASE")
)

def convert_to_bullets(text: str) -> str:
    prompt = f"""
Convert the following paragraph into short, meaningful bullet points:

{text}
"""
    
    response = client.chat.completions.create(
        model="openai/gpt-4.1-mini",
        messages=[
            {
                "role": "user",
                "content": prompt
            }
        ],
        max_tokens=150,
        temperature=0.1
    )

    return response.choices[0].message.content


paragraph = (
    "Artificial Intelligence is transforming industries by automating tasks, "
    "improving decision-making, and enabling new innovations across healthcare, "
    "finance, and education."
)

response = convert_to_bullets(paragraph)

print(response)

There’s another error related to the “openai/gpt-4.1” model. When I run it with that model, it gives an error, but it works correctly when I use the “openai/gpt-4.1-mini” model. Keep in mind that the lab instructions specify using the “openai/gpt-4.1” model.

Could you please share the name of the lab or the day number if it’s from 100Days of AI?

Yes, laboratory number 5: Convert Data with AI

Yup, I just verified, and it’s a bug.
It looks like the validator is not properly picking up values loaded through os.getenv() . When api_key and base_url are provided as string literals, validation succeeds, but using environment variables causes validation to fail.

Thanks for reporting. I’ve informed the team to fix this.

Meanwhile, if this is a blocker, you can use string literals for api_key and base_url and proceed.

Hi @fsialercloud

The issue is resolved. The lab now works with os.getenv() and also os.environ.get() for reading API keys and base URL.

Thanks for your patience and support.