Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1.26.0 upgrade: Add attributes to messages #20

Open
CakeCrusher opened this issue May 7, 2024 · 0 comments
Open

1.26.0 upgrade: Add attributes to messages #20

CakeCrusher opened this issue May 7, 2024 · 0 comments
Labels
feature Feature to improve the objective of HexAmorous

Comments

@CakeCrusher
Copy link

depends on #18
example with file_search:

messages = client.beta.threads.messages.list(
    thread_id=thread.id
)
{
  "data": [
    {
      "id": "msg_ED5JAicrhN4hFz0tN3VL2nGy",
      "assistant_id": "asst_7Asu2r1ZCuz8FrydJUYKrGVY",
      "attachments": [],
      "completed_at": null,
      "content": [
        {
          "text": {
            "annotations": [
              {
                "end_index": 954,
                "file_citation": {
                  "file_id": "file-giEo3NN4k74QbUVOfP7TWOEK",
                  "quote": null
                },
                "start_index": 942,
                "text": "【4:0†source】",
                "type": "file_citation"
              }
            ],
            "value": "The parameters for creating an assistant using `openai_client.beta.assistants.create` include:\n\n- **instructions**: The system instructions that the assistant uses.\n- **name**: The name of the assistant.\n- **tools**: A list of tools enabled on the assistant, each entry specifying the tool type.\n- **model**: The model to be used by the assistant (e.g., \"gpt-4\").\n- **metadata**: A dictionary containing up to 16 key-value pairs that can be attached to the assistant.\n\nHere is an example of how these parameters might be used in a call to the `create` method:\n\n```python\nresponse = openai_client.beta.assistants.create(\n    instructions=\"You are an AI designed to provide examples.\",\n    name=\"Example Assistant\",\n    tools=[{\"type\": \"code_interpreter\"}],\n    model=\"gpt-4\",\n    metadata={\"str\": \"string\", \"int\": 1, \"bool\": True, \"list\": [1, 2, 3]},\n)\n```\n\nThis example assumes that the \"code_interpreter\" is an enabled tool for the assistant【4:0†source】."
          },
          "type": "text"
        }
      ],
      "created_at": 1715056757,
      "incomplete_at": null,
      "incomplete_details": null,
      "metadata": {},
      "object": "thread.message",
      "role": "assistant",
      "run_id": "run_uNgH6X3snV25MWy70BJswcCg",
      "status": null,
      "thread_id": "thread_UyFDMzEKDuKqVyoB02xMiuI4"
    },
    {
      "id": "msg_AfNLGo5pVMImBwX9NHZod7OF",
      "assistant_id": null,
      "attachments": [],
      "completed_at": null,
      "content": [
        {
          "text": {
            "annotations": [],
            "value": "what are the parameters to creating an assistant using openai_client.beta.assistants.create"
          },
          "type": "text"
        }
      ],
      "created_at": 1715056746,
      "incomplete_at": null,
      "incomplete_details": null,
      "metadata": {},
      "object": "thread.message",
      "role": "user",
      "run_id": null,
      "status": null,
      "thread_id": "thread_UyFDMzEKDuKqVyoB02xMiuI4"
    }
  ],
  "object": "list",
  "first_id": "msg_ED5JAicrhN4hFz0tN3VL2nGy",
  "last_id": "msg_AfNLGo5pVMImBwX9NHZod7OF",
  "has_more": false
}
@CakeCrusher CakeCrusher added the feature Feature to improve the objective of HexAmorous label May 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Feature to improve the objective of HexAmorous
Projects
None yet
Development

No branches or pull requests

1 participant