Targets¶
- class aisploit.targets.BedrockAmazonImageTarget(size: Literal['512x512', '1024x1024'] = '512x512', show_image: bool = False, session: boto3.session.Session = <factory>, region_name: str = 'us-east-1', model: str = 'titan-image-generator-v1', quality: str = 'standard', seed: int = 0, cfg_scale: int = 8)¶
Bases:
BaseBedrockImageTarget
- cfg_scale: int¶
- model: str¶
- quality: str¶
- seed: int¶
- class aisploit.targets.BedrockStabilityImageTarget(size: Literal['512x512', '1024x1024'] = '512x512', show_image: bool = False, session: boto3.session.Session = <factory>, region_name: str = 'us-east-1', model: str = 'stable-diffusion-xl-v1', steps: int = 50, seed: int = 0, cfg_scale: int = 8)¶
Bases:
BaseBedrockImageTarget
- cfg_scale: int¶
- model: str¶
- seed: int¶
- steps: int¶
- class aisploit.targets.CopilotClient(*, conversation_style: Literal['balanced', 'creative', 'precise'] = 'balanced', bing_cookies: str | None = None, bundle_version: str = '1.1690.0')¶
Bases:
object
A class representing the client for interacting with Copilot.
- bing_cookies: str | None¶
- bundle_version: str¶
- client_id: str | None¶
- close_conversation() None ¶
Close the conversation with Copilot.
- conversation_id: str | None¶
- conversation_signature: str | None¶
- conversation_style: Literal['balanced', 'creative', 'precise']¶
- create_completion(prompt: str, search: bool = True, raw: bool = False) Dict[str, Any] ¶
Create a completion request and interact with Copilot.
- Args:
prompt (str): The prompt to send to Copilot. search (bool, optional): Whether to allow search. Defaults to True. raw (bool, optional): Whether to return raw response. Defaults to False.
- Returns:
Dict[str, Any]: The response received from Copilot.
- invocation_id: int¶
- session: Session | None¶
- start_conversation() None ¶
Start a conversation with Copilot.
- ws_connection: WebSocket | None¶
- class aisploit.targets.CopilotTarget(conversation_style: Literal['balanced', 'creative', 'precise'] = 'balanced', bing_cookies: str | None = None, bundle_version: str = '1.1690.0')¶
Bases:
BaseTarget
A class representing the target for sending prompts to Copilot.
- bing_cookies: str | None¶
- bundle_version: str¶
- conversation_style: Literal['balanced', 'creative', 'precise']¶
- class aisploit.targets.EmailReceiver(host: str, auth: aisploit.targets.email.UserPasswordAuth, port: int | None = None, folder: str = 'INBOX', ssl: bool = True, ssl_context: ssl.SSLContext | None = None)¶
Bases:
object
- auth: UserPasswordAuth¶
- folder: str¶
- host: str¶
- listen_for_emails(from_addr: str, timeout=None) List[str] ¶
- port: int | None¶
- ssl: bool¶
- ssl_context: SSLContext | None¶
- class aisploit.targets.EmailSender(host: str, auth: aisploit.targets.email.UserPasswordAuth, port: int | None = None, ssl: bool = True, ssl_context: ssl.SSLContext | None = None)¶
Bases:
object
- auth: UserPasswordAuth¶
- host: str¶
- port: int | None¶
- send_email(from_addr: str, to_addr: str, subject: str, body: str)¶
- ssl: bool¶
- ssl_context: SSLContext | None¶
- class aisploit.targets.EmailTarget(sender: aisploit.targets.email.EmailSender, receiver: aisploit.targets.email.EmailReceiver, subject: str, from_addr: str, to_addr: str)¶
Bases:
BaseTarget
- from_addr: str¶
- receiver: EmailReceiver¶
- send_prompt(prompt: PromptValue) Response ¶
Send a prompt to the target and return the response.
- Args:
prompt (BasePromptValue): The prompt to send.
- Returns:
Response: The response from the target.
- sender: EmailSender¶
- subject: str¶
- to_addr: str¶
- class aisploit.targets.LangchainTarget(model: langchain_core.language_models.base.BaseLanguageModel)¶
Bases:
BaseTarget
- model: BaseLanguageModel¶
- class aisploit.targets.OpenAIImageTarget(size: Literal['512x512', '1024x1024'] = '512x512', show_image: bool = False, api_key: str | None = None)¶
Bases:
BaseImageTarget
- api_key: str | None¶
- class aisploit.targets.StdOutTarget(text_stream: IO[str] = <_io.TextIOWrapper name='<stdout>' mode='w' encoding='utf-8'>)¶
Bases:
BaseTarget
- send_prompt(prompt: PromptValue) Response ¶
Send a prompt to the target and return the response.
- Args:
prompt (BasePromptValue): The prompt to send.
- Returns:
Response: The response from the target.
- text_stream: IO[str]¶
- class aisploit.targets.UserPasswordAuth(user: str, password: str)¶
Bases:
object
- password: str¶
- user: str¶
- class aisploit.targets.WrapperTarget(func: Callable)¶
Bases:
BaseTarget
- func: Callable¶
- aisploit.targets.target(func: Callable) WrapperTarget ¶