|
67 | 67 | "1. Authenticate to Google Cloud\n", |
68 | 68 | "2. Add data\n", |
69 | 69 | "3. Perform agent operations (create, list, get, delete)\n", |
70 | | - "4. Manage conversations (create, list, get)\n", |
| 70 | + "4. Manage conversations (create, list, get, delete)\n", |
71 | 71 | "5. Ask questions with your agent\n" |
72 | 72 | ] |
73 | 73 | }, |
|
744 | 744 | " print(conversation_response.text)" |
745 | 745 | ] |
746 | 746 | }, |
| 747 | + { |
| 748 | + "cell_type": "code", |
| 749 | + "execution_count": null, |
| 750 | + "metadata": { |
| 751 | + "id": "3TASe-HCxtss" |
| 752 | + }, |
| 753 | + "outputs": [], |
| 754 | + "source": [ |
| 755 | + "# @title Delete Conversation\n", |
| 756 | + "\n", |
| 757 | + "# fmt: off\n", |
| 758 | + "conversation_id = \"conversation_1\" # @param {type:\"string\"}\n", |
| 759 | + "# fmt: on\n", |
| 760 | + "\n", |
| 761 | + "conversation_url = f\"{base_url}/{api_version}/projects/{billing_project}/locations/{location}/conversations/{conversation_id}\"\n", |
| 762 | + "\n", |
| 763 | + "conversation_response = requests.delete(conversation_url, headers=headers)\n", |
| 764 | + "\n", |
| 765 | + "# Handle the response\n", |
| 766 | + "if conversation_response.status_code == 200:\n", |
| 767 | + " print(\"Conversation deleted successfully!\")\n", |
| 768 | + " print(json.dumps(conversation_response.json(), indent=2))\n", |
| 769 | + "else:\n", |
| 770 | + " print(f\"Error while deleting conversation: {conversation_response.status_code}\")\n", |
| 771 | + " print(conversation_response.text)" |
| 772 | + ] |
| 773 | + }, |
747 | 774 | { |
748 | 775 | "cell_type": "code", |
749 | 776 | "execution_count": null, |
|
0 commit comments