-
Notifications
You must be signed in to change notification settings - Fork 359
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
Using PyRIT on OpenAI API #124
Comments
Are you using a release version of the latest main branch? In the latest main branch there's |
It seems you're utilizing Before executing the code, make sure to configure the necessary environment variables. import os
from pyrit.common import default_values
from pyrit.prompt_target import OpenAIChatTarget
from pyrit.models import ChatMessage
default_values.load_default_env()
target_llm = OpenAIChatTarget(
deployment_name=os.environ.get("OPENAI_CHAT_KEY"),
endpoint=os.environ.get("OPENAI_CHAT_ENDPOINT"),
api_key=os.environ.get("OPENAI_CHAT_DEPLOYMENT"),
)
prompt = "test"
target_llm.complete_chat(messages=[ChatMessage(content=prompt, role="user")]) |
The pyrit version is the one that matters. If you follow the instructions in the "bug report" issue template you'll find this:
I suspect you're using v0.1.1 rather than 0.1.2. This is newly added there. |
Thank you so much for your help! I was able to make it work on the basic gpt 3.5. It does seem that I had some issues setting up our model. Thank you. |
Hello, I am from the Cybersecurity Laboratory of National University of Singapore. I am interested in using PyRIT for checking the robustness of LLM models.
I have the following LLM from my openai subscription:
target_llm = OpenAI(api_key=os.environ.get("OPENAI_API_KEY_NUS"))
May I ask how do I implement PyRIT on an LLM that does not come from AzureOpenAI?
I do not have an azureopenai subscription so I could not utilize the code available in
doc/code/demo/
.Thank you for your assistance!
The text was updated successfully, but these errors were encountered: