Guest User

Untitled

a guest
Sep 30th, 2026
71
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. import os
  2. from openai import OpenAI
  3.  
  4. from dotenv import load_dotenv
  5. import textwrap
  6.  
  7. load_dotenv()
  8. OpenAI.api_key = os.getenv("OPENAI_API_KEY")
  9. client = OpenAI()
  10.  
  11. instructions_1 = """
  12. please make sure any XXX point/code has never been implemented in this code base. and deptTypeID == \\"XXX" should be disabled. We do not need this XXX function in our webapp, so make sure this XXX code has been disabled or discarded in the codebase
  13.  
  14. """
  15. tools = [
  16. {
  17. "type": "function",
  18. "function": {
  19. "name": "search",
  20. "description": instructions_1,
  21. "parameters": {
  22. "type": "object",
  23. "properties": {
  24. "desc": {
  25. "type": "string",
  26. "description": instructions_1,
  27. },
  28. },
  29. "required": ["desc"],
  30. },
  31. }
  32. }
  33. ]
  34. messages = [{"role": "user", "content": instructions_1}]
  35. completion = client.chat.completions.create(
  36. model="gpt-4o",
  37. messages=messages,
  38. tools=tools,
  39. tool_choice="auto"
  40. )
  41. print("test output")
  42. print(completion.choices[0].message.tool_calls[0])
  43. print("test completion")
  44. print(completion)
  45.  
Advertisement
Add Comment
Please, Sign In to add comment