datadabllp

LLM agent assists in strategic analysis

Aug 20th, 2024
573
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.71 KB | None | 0 0
  1. import openai
  2.  
  3. def strategic_analysis(market_data, competitor_info, financial_reports):
  4.     prompt = f"""
  5.    Given the following data:
  6.    Market trends: {market_data}
  7.    Competitor information: {competitor_info}
  8.    Financial reports: {financial_reports}
  9.  
  10.    Provide a strategic analysis with the following:
  11.    1. Key market opportunities
  12.    2. Potential threats
  13.    3. Recommended strategic actions
  14.    """
  15.    
  16.     response = openai.Completion.create(
  17.         engine="text-davinci-002",
  18.         prompt=prompt,
  19.         max_tokens=500
  20.     )
  21.    
  22.     return response.choices[0].text.strip()
  23.  
  24. # Usage
  25. analysis = strategic_analysis(market_data, competitor_info, financial_reports)
  26. print(analysis)
  27.  
Advertisement
Add Comment
Please, Sign In to add comment