Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import os
- from openai import OpenAI
- from dotenv import load_dotenv
- import textwrap
- load_dotenv()
- OpenAI.api_key = os.getenv("OPENAI_API_KEY")
- client = OpenAI()
- instructions_1 = """
- 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
- """
- tools = [
- {
- "type": "function",
- "function": {
- "name": "search",
- "description": instructions_1,
- "parameters": {
- "type": "object",
- "properties": {
- "desc": {
- "type": "string",
- "description": instructions_1,
- },
- },
- "required": ["desc"],
- },
- }
- }
- ]
- messages = [{"role": "user", "content": instructions_1}]
- completion = client.chat.completions.create(
- model="gpt-4o",
- messages=messages,
- tools=tools,
- tool_choice="auto"
- )
- print("test output")
- print(completion.choices[0].message.tool_calls[0])
- print("test completion")
- print(completion)
Advertisement
Add Comment
Please, Sign In to add comment