import vertexai from vertexai.language_models import TextGenerationModel def interview( temperature: float, project_id: str, location: str, ) -> str: """Ideation example with a Large Language Model""" project_id= "agileai-poc" location="us-central1" vertexai.init(project=project_id, location=location) # TODO developer - override these parameters as needed: parameters = { "temperature": temperature, # Temperature controls the degree of randomness in token selection. "max_output_tokens": 256, # Token limit determines the maximum amount of text output. "top_p": 0.8, # Tokens are selected from most probable to least until the sum of their probabilities equals the top_p value. "top_k": 40, # A top_k of 1 means the selected token is the most probable among all tokens. } model = TextGenerationModel.from_pretrained("text-bison@001") response = model.predict( "Give me ten interview questions for the role of program manager.", **parameters, ) print(f"Response from Model: {response.text}") { "predictions": [ { "content": str, "citationMetadata": { "citations": [ { "startIndex": int, "endIndex": int, "url": str, "title": str, "license": str, "publicationDate": str } ] }, "safetyAttributes": { "categories": [str], "blocked": bool, "scores": [ number ] } } ] } { "predictions": [ { "citationMetadata": { "citations": [] }, "safetyAttributes": { "scores": [ 0.1 ], "categories": [ "Finance" ], "blocked": False }, "content": "1. What is your experience with project management?\n2. What are your strengths and weaknesses as a project manager?\n3. How do you handle conflict and difficult situations?\n4. How do you communicate with stakeholders?\n5. How do you stay organized and on track?\n6. How do you manage your time effectively?\n7. What are your goals for your career?\n8. Why are you interested in this position?\n9. What are your salary expectations?\n10. What are your availability and start date?" } ] }