OpenAI Completions - optional

OpenAI Completions - optional#

Before you begin, ensure you are setup with the correct version of PyRIT and have the applicable secrets configured as described here.

Once you are configured, then you will be able to get completions for your text.

from pyrit.executor.attack import ConsoleAttackResultPrinter, PromptSendingAttack
from pyrit.prompt_target import OpenAICompletionTarget
from pyrit.setup import IN_MEMORY, initialize_pyrit_async

await initialize_pyrit_async(memory_db_type=IN_MEMORY)  # type: ignore

# Note that max_tokens will default to 16 for completions, so you may want to set the upper limit of allowed tokens for a longer response.
target = OpenAICompletionTarget(max_tokens=2048)

attack = PromptSendingAttack(objective_target=target)
result = await attack.execute_async(objective="Hello! Who are you?")  # type: ignore
await ConsoleAttackResultPrinter().print_conversation_async(result=result)  # type: ignore
────────────────────────────────────────────────────────────────────────────────────────────────────
🔹 Turn 1 - USER
────────────────────────────────────────────────────────────────────────────────────────────────────
  Hello! Who are you?

────────────────────────────────────────────────────────────────────────────────────────────────────
🔸 ASSISTANT
────────────────────────────────────────────────────────────────────────────────────────────────────
   I'm stumped!!! Trust your intuition!
  
    [A1] Purpose of actor personas
  
    [Q1] Suggestions and discussion for the names for the actor personas - a query regarding whom to
      focus on and target and also provide criteria for deciding whether we have a full set of
      personas or not
  
    [Q2] [Q3] [Q4] Actors structure according to functionality - How do we ensure that actors are
      identified against specific (relevant) functionality in the programme?
  
    A1] Purpose of actor personas
  
    You should have a richer understanding of the needs, constraints, and characteristics of the
      different users who are going to use the system.
  
    We should be able to quantify the parts of the system that each persona will conceive as important
      and say why that is, which would allow us to predict how much maintenance we will end up doing.
  
    By associating who belongs to which persona(s), we can tell the department who they are marketing
      the system to. This will lead to more accurate and comprehensive market consideration planning
      which in turn provides better value for money, as we can propose more accurate features and
      calibration based on the data we obtain from evaluation.
  
    However, the cost of any system is never solely based on its development, but rather extends to
      its assorted activities. Hence, accuracy beyond requirement should also be considered and
      strictly abided by. Hence, we conclude that a persona(s) needs validation via feedback provided
      by the user, additional analysis and some degree of verification of factors such as:
    a. Prioritisation of benefit requires resource and enhances assurance to each respective users.
    b. Quantifications of those which TA2 and TA2 not aware of
  
    Actor Persona
  
    As such, we can now return to the question brought up to visualise who exactly would be our
      user(s). This ISA diagram can be used to construct this ideal description of who would interact
      with the system in both a tangible and non-tangible manner:
  
    Figure 1
  
    Where:-
  
    - A and C is our user who intends to conduct a regulatory requirement exercise.
    - E is the service provider who provides the application.
    - B is the application provider who develops the application for the system supplier.
  
    The classes of actors are defined as follows:-
  
    - Administrators — Individuals or organisations that are responsible for updating one or more
      document repositories. They normally perform this task locally on their own desktop
      workstations. Although, in some cases, there may be dedicated workstations to perform these
      tasks. This group may also be responsible for tracking regulatory changes and assuring that the
      later corresponds to the specifications of the document repositories in the system.
    - Users — Individuals or organisations that will be interfacing either directly with the
      application or indirectly by way of automation. There may be users that will be converting a
      local document repository in preparation for import into the application. This conversion may be
      performed either voluntarily or involuntarily as the result of a user being unable to access
      their local environment with administrative rights in order to manage their document
      repositories. The result of either scenario may require that the user return to their system
      supplier to request resolution.
    - Service and Support Organisations — These are third party organisations that provide technical
      support and other services to assist users with the application.
  
    Any user that represents an organisation is an Administrator with the possible exception that
      their duties may overlap with that of Users. Organisation overlaps with Administrator and may or
      may not be a User. These groups have different reasons, needs and concerns. PSAs can only be
      approbated if there will be adherents support from users and administrator groupings, rather
      than merely organisers
  
    Social Categories of Characters: Who are they basically? This is one of three questions addressed
      by characters, which includes:
  
    - Personality traits and characteristics
    - The way the character acts in social situations
    - The perspective the character has on reality in general, and the issue under consideration
      specifically
  
    Characteristics:
  
    - Goals — What does the character want to accomplish. In your example, this is “a regulatory
      requirement exercise.”
    - Type of Challenges — What types of problems does the character face. In your example, this is
      “regulatory requirement exercise.”
    - Perceived outcome of challenge — How does the character anticipate/describe the final outcome.
      In your example, this is “Don’t understand how, intend to blah blah blah.”
    - Impact — How important is it to the character to accomplish the goal, and/or overcome the
      challenges. In your example, this is “little importance”
  
    Perspective: This defines the the position or attitude a character has toward the issue, person or
      thing under review.
  
    Need visual of Dialogue:
  
    - Speaker: You
    - Addressee: Us
    - Speaker's emotion: Confused
    - Addressee's emotion: Interested
    - Speaker's attitude: Friendly
    - Addressee's attitude: Chore task
  
    Who is Your Client?
  
    Your client is the party sponsoring the request for the document in question. In order to
      understand the positioning of what document as find out:
  
    - Who are the other competitors? This includes not just who would be targeting the same audience
      as us but also potential users within the organisation and department.
    - Who are the other audiences? What are their exact roles, goals and responsibilities that we need
      to consider? This includes also who is working in the department and in the Ministry.
    - Who are our competitors? Be sure to avoid circular reasoning. For example, "We are doing this
      because we need information from our users. And that's who we are targeting. And the reason we
      know we need the content is because we need information from our users. And we know we're going
      to be doing this because we need content from our users. and the reason we know we need content
      from our users is because we know they want information."
  
    [Q1] Suggestions and discussion for the names for the actor personas
  
    Table of Persona characters who we could target as end users
  
    Name Description
    Administrator - An actual user who represents an organisation - An employee of the organisation -
      Co-ordinates the involvement of the system supplier on behalf of the organisation - Can’ be
      merely an tester, software issue troubleshooter or purchaser as found on yt, need not or may not
      be full time either! - Authorities to push a group of users to
  
    Use Case: Add Update Modify Users
  
    - Requires Update Requests
  
    Document Provider (existing frustrates format) - Potential user to convert text others to us line
      based documents! - The existing document provider
  
    - A team of ends user possibly?(Need to find out interview!) (The group being the one who gathers
      and oversees documents/requirement. Also the one who carries out tasks)
    - One Document Founder? (This one cannot see store client info)
  
    - Developer Team when producing the system - can be the Service Provider too
  
    Type of Users ??
  
    Update Things In Acceptable Applications/Projects (UI acceptance/integration to help /platforms
      team?)
  
    TA Out
  
    Structures A1[A1] TA Cm Roles & Jong Kia Mun Combining Catalogue of Magpie Article and
    the logo
  
  
  
    R1[A1] RM Android App for Epub Reader
    http://git.iis.sinica.edu.tw/sohandrew/android-mangopub
    https://code.google.com/p/mangopub/
  
  
  
  
    R2[A1] Rb+Rc Pixel Perfect Images
    http://jimisof.co.uk/2011/12/15/pixel-perfect-images/
    http://webdesign.tutsplus.com/tutorials/how-to-design-true-vector-icons-in-adobe-illustrator/
    http://www.alwayshost.com/free-twitter-retweet-design-footprint-freebie/
    http://www.alwayshost.com/free-download-facebook-like-box-icon-widget-footprint-freebie/
    http://www.alwayshost.com/free-download-twitter-follow-box-icon-widget-footprint-freebie/
    http://www.alwayshost.com/free-download-emoji-getlist-icon-widget-footprint-freebie/
    http://www.alwayshost.com/free-download-facebook-like-btn-inline-icons-footprint-freebie/
    http://www.alwayshost.com/free-download-facebook-wordmark-icon-footprint-freebie/
    http://www.alwayshost.com/free-download-google-plus-icon-footer-freebie/
    http://www.alwayshost.com/free-download-linkedin-icon-footer-freebie/
    http://www.alwayshost.com/free-download-vimeo-icon-footer-freebie/
    http://www.alwayshost.com/free-download-instagram-icon-footer-freebie/
    http://www.alwayshost.com/twitter-down-2942012-fix/
    http://www.alwayshost.com/facebook-web-feeds-fix/
    http://www.alwayshost.com/iphone-suspended-0-day-warning-appears-to-bots/facebook-web-feeds-fix/
  
  
    R3[A1] RC Visual Comphrension R Tapping Gradient
  
    http://le-monddefeig.free.fr/java_text/gradient_text/input_form.php#a
  
  
  
    R4[A1] RB Creation of the App
    Drawing flow of App:
      http://enhancedcompression.googlecode.com/svn/trunk/doc/sketch/diagrams/Batch_a.png
  
  
    R5[A1] See iPad Javascript emulator
  
    http://lac.miniurl.com/iPad2HStatusBar-displays-
    http://jetimpex.com/web/iPad2HStatusBar-displays.html
    http://lab.mathiasbynens.be/word-wrap/ipad
  
    Epub Reader
  
    Chapter 1 Getting Started
  
    EpubReader is a web application belonging to http://helind.tudelft.nl.
    This application was developed for players with different platforms.
  
    Interfaces
  
    Connecting User Preferences
  
    The initial results of my research indicate that most of the experienced epub constomers first go
      to the preferences page of epub reader on startup, true, I would also like to have a button to
      close it down too.
  
    One result of the interface for new users to Ekphrasis Book Store is very different from those of
      experienced epub constomers. For instance, I want to add a button to the home page enabling a
      user to access the fav orite’s page and add the corresponding button to the homescreen.
      Additionally, when the buffer is

────────────────────────────────────────────────────────────────────────────────────────────────────