pleasepoint_py.genai

class genai:

Usage examples with AIstudio:

from pleasepoint_py import AIStudio
studio = AIStudio()
studio.genai.invoke_model(model_id='anthropic.claude-v2', prompt_string='Hello', max_tokens=100, temperature=0.7)
studio.genai.invoke_agent(prompt_string='Help me', session_id='session-123', agent_id='agent-456', agent_alias_id='alias-789')
def invoke_model( self, model_id: str, prompt_string: str, max_tokens: int = 300, temperature: float = 0.7):

Generate a response from an AWS Bedrock model.

Parameters
  • model_id: ID of the Bedrock model
  • prompt_string: Text of the prompt to send to the model
  • max_tokens: Maximum number of tokens for the response (default: 300)
  • temperature: Temperature to control creativity (default: 0.7)
Returns

Model response

def invoke_agent( self, prompt_string: str, session_id: str, agent_id: str, agent_alias_id: str):

Invoke a Bedrock agent.

Parameters
  • prompt_string: Text of the prompt to send to the agent
  • session_id: ID of the agent session
  • agent_id: ID of the agent
  • agent_alias_id: ID of the agent alias
Returns

Agent completion