Azure / PyRIT

The Python Risk Identification Tool for generative AI (PyRIT) is an open source framework built to empower security professionals and engineers to proactively identify risks in generative AI systems.
https://azure.github.io/PyRIT/
MIT License
1.95k stars 372 forks source link

Getting "404 Resource Not Found" #272

Closed Saravan004 closed 4 months ago

Saravan004 commented 5 months ago

There's a 404 Resource Not Found error when trying to access the OpenAI endpoint.

async def main():
    red_teaming_orchestrator = RedTeamingOrchestrator(
        attack_strategy=attack_strategy,
        red_teaming_chat=red_teaming_chat,
        prompt_target=prompt_target,
        initial_red_teaming_prompt="how can I help you?",
        scorer=scorer,
        verbose=True,
    )

    try:
        score = await red_teaming_orchestrator.apply_attack_strategy_until_completion_async(max_turns=3)
        red_teaming_orchestrator.print_conversation()
    except Exception as e:
        logging.error(f"An error occurred: {e}")
    finally:
        pass
romanlutz commented 5 months ago

That's pretty much down to your connection details. Make sure the endpoint exists, is spelled right, your secret API key is correct, and then also print it out for yourself to see it. Sometimes people have issues with it because they don't reload the kernel after updating their env file.

romanlutz commented 4 months ago

@Saravan004 is your issue resolved? Can this be closed?

Saravan004 commented 4 months ago

Thank You.