|
834 | 834 | "type": "string",
|
835 | 835 | "title": "Workspace Name"
|
836 | 836 | }
|
| 837 | + }, |
| 838 | + { |
| 839 | + "name": "page", |
| 840 | + "in": "query", |
| 841 | + "required": false, |
| 842 | + "schema": { |
| 843 | + "type": "integer", |
| 844 | + "minimum": 1, |
| 845 | + "default": 1, |
| 846 | + "title": "Page" |
| 847 | + } |
| 848 | + }, |
| 849 | + { |
| 850 | + "name": "page_size", |
| 851 | + "in": "query", |
| 852 | + "required": false, |
| 853 | + "schema": { |
| 854 | + "type": "integer", |
| 855 | + "maximum": 100, |
| 856 | + "minimum": 1, |
| 857 | + "default": 50, |
| 858 | + "title": "Page Size" |
| 859 | + } |
| 860 | + }, |
| 861 | + { |
| 862 | + "name": "filter_by_ids", |
| 863 | + "in": "query", |
| 864 | + "required": false, |
| 865 | + "schema": { |
| 866 | + "anyOf": [ |
| 867 | + { |
| 868 | + "type": "array", |
| 869 | + "items": { |
| 870 | + "type": "string" |
| 871 | + } |
| 872 | + }, |
| 873 | + { |
| 874 | + "type": "null" |
| 875 | + } |
| 876 | + ], |
| 877 | + "title": "Filter By Ids" |
| 878 | + } |
| 879 | + }, |
| 880 | + { |
| 881 | + "name": "filter_by_alert_trigger_types", |
| 882 | + "in": "query", |
| 883 | + "required": false, |
| 884 | + "schema": { |
| 885 | + "anyOf": [ |
| 886 | + { |
| 887 | + "type": "array", |
| 888 | + "items": { |
| 889 | + "$ref": "#/components/schemas/AlertTriggerType" |
| 890 | + } |
| 891 | + }, |
| 892 | + { |
| 893 | + "type": "null" |
| 894 | + } |
| 895 | + ], |
| 896 | + "title": "Filter By Alert Trigger Types" |
| 897 | + } |
837 | 898 | }
|
838 | 899 | ],
|
839 | 900 | "responses": {
|
|
842 | 903 | "content": {
|
843 | 904 | "application/json": {
|
844 | 905 | "schema": {
|
845 |
| - "type": "array", |
846 |
| - "items": { |
847 |
| - "$ref": "#/components/schemas/Conversation" |
848 |
| - }, |
849 |
| - "title": "Response V1 Get Workspace Messages" |
| 906 | + "$ref": "#/components/schemas/PaginatedMessagesResponse" |
| 907 | + } |
| 908 | + } |
| 909 | + } |
| 910 | + }, |
| 911 | + "422": { |
| 912 | + "description": "Validation Error", |
| 913 | + "content": { |
| 914 | + "application/json": { |
| 915 | + "schema": { |
| 916 | + "$ref": "#/components/schemas/HTTPValidationError" |
| 917 | + } |
| 918 | + } |
| 919 | + } |
| 920 | + } |
| 921 | + } |
| 922 | + } |
| 923 | + }, |
| 924 | + "/api/v1/workspaces/{workspace_name}/messages/{prompt_id}": { |
| 925 | + "get": { |
| 926 | + "tags": [ |
| 927 | + "CodeGate API", |
| 928 | + "Workspaces" |
| 929 | + ], |
| 930 | + "summary": "Get Messages By Prompt Id", |
| 931 | + "description": "Get messages for a workspace.", |
| 932 | + "operationId": "v1_get_messages_by_prompt_id", |
| 933 | + "parameters": [ |
| 934 | + { |
| 935 | + "name": "workspace_name", |
| 936 | + "in": "path", |
| 937 | + "required": true, |
| 938 | + "schema": { |
| 939 | + "type": "string", |
| 940 | + "title": "Workspace Name" |
| 941 | + } |
| 942 | + }, |
| 943 | + { |
| 944 | + "name": "prompt_id", |
| 945 | + "in": "path", |
| 946 | + "required": true, |
| 947 | + "schema": { |
| 948 | + "type": "string", |
| 949 | + "title": "Prompt Id" |
| 950 | + } |
| 951 | + } |
| 952 | + ], |
| 953 | + "responses": { |
| 954 | + "200": { |
| 955 | + "description": "Successful Response", |
| 956 | + "content": { |
| 957 | + "application/json": { |
| 958 | + "schema": { |
| 959 | + "$ref": "#/components/schemas/Conversation" |
850 | 960 | }
|
851 | 961 | }
|
852 | 962 | }
|
|
1660 | 1770 | "secrets": {
|
1661 | 1771 | "type": "integer",
|
1662 | 1772 | "title": "Secrets"
|
| 1773 | + }, |
| 1774 | + "total_alerts": { |
| 1775 | + "type": "integer", |
| 1776 | + "title": "Total Alerts" |
1663 | 1777 | }
|
1664 | 1778 | },
|
1665 | 1779 | "type": "object",
|
1666 | 1780 | "required": [
|
1667 | 1781 | "malicious_packages",
|
1668 | 1782 | "pii",
|
1669 |
| - "secrets" |
| 1783 | + "secrets", |
| 1784 | + "total_alerts" |
1670 | 1785 | ],
|
1671 | 1786 | "title": "AlertSummary",
|
1672 | 1787 | "description": "Represents a set of summary alerts"
|
1673 | 1788 | },
|
| 1789 | + "AlertTriggerType": { |
| 1790 | + "type": "string", |
| 1791 | + "enum": [ |
| 1792 | + "codegate-pii", |
| 1793 | + "codegate-context-retriever", |
| 1794 | + "codegate-secrets" |
| 1795 | + ], |
| 1796 | + "title": "AlertTriggerType" |
| 1797 | + }, |
1674 | 1798 | "ChatMessage": {
|
1675 | 1799 | "properties": {
|
1676 | 1800 | "message": {
|
|
1820 | 1944 | ]
|
1821 | 1945 | },
|
1822 | 1946 | "alerts": {
|
1823 |
| - "items": { |
1824 |
| - "$ref": "#/components/schemas/Alert" |
1825 |
| - }, |
1826 |
| - "type": "array", |
| 1947 | + "anyOf": [ |
| 1948 | + { |
| 1949 | + "items": { |
| 1950 | + "$ref": "#/components/schemas/Alert" |
| 1951 | + }, |
| 1952 | + "type": "array" |
| 1953 | + }, |
| 1954 | + { |
| 1955 | + "type": "null" |
| 1956 | + } |
| 1957 | + ], |
1827 | 1958 | "title": "Alerts",
|
1828 | 1959 | "default": []
|
1829 | 1960 | }
|
|
1840 | 1971 | "title": "Conversation",
|
1841 | 1972 | "description": "Represents a conversation."
|
1842 | 1973 | },
|
| 1974 | + "ConversationSummary": { |
| 1975 | + "properties": { |
| 1976 | + "chat_id": { |
| 1977 | + "type": "string", |
| 1978 | + "title": "Chat Id" |
| 1979 | + }, |
| 1980 | + "prompt": { |
| 1981 | + "$ref": "#/components/schemas/ChatMessage" |
| 1982 | + }, |
| 1983 | + "alerts_summary": { |
| 1984 | + "$ref": "#/components/schemas/AlertSummary" |
| 1985 | + }, |
| 1986 | + "token_usage_agg": { |
| 1987 | + "anyOf": [ |
| 1988 | + { |
| 1989 | + "$ref": "#/components/schemas/TokenUsageAggregate" |
| 1990 | + }, |
| 1991 | + { |
| 1992 | + "type": "null" |
| 1993 | + } |
| 1994 | + ] |
| 1995 | + }, |
| 1996 | + "provider": { |
| 1997 | + "anyOf": [ |
| 1998 | + { |
| 1999 | + "type": "string" |
| 2000 | + }, |
| 2001 | + { |
| 2002 | + "type": "null" |
| 2003 | + } |
| 2004 | + ], |
| 2005 | + "title": "Provider" |
| 2006 | + }, |
| 2007 | + "type": { |
| 2008 | + "$ref": "#/components/schemas/QuestionType" |
| 2009 | + }, |
| 2010 | + "conversation_timestamp": { |
| 2011 | + "type": "string", |
| 2012 | + "format": "date-time", |
| 2013 | + "title": "Conversation Timestamp" |
| 2014 | + } |
| 2015 | + }, |
| 2016 | + "type": "object", |
| 2017 | + "required": [ |
| 2018 | + "chat_id", |
| 2019 | + "prompt", |
| 2020 | + "alerts_summary", |
| 2021 | + "token_usage_agg", |
| 2022 | + "provider", |
| 2023 | + "type", |
| 2024 | + "conversation_timestamp" |
| 2025 | + ], |
| 2026 | + "title": "ConversationSummary", |
| 2027 | + "description": "Represents a conversation summary." |
| 2028 | + }, |
1843 | 2029 | "CustomInstructions": {
|
1844 | 2030 | "properties": {
|
1845 | 2031 | "prompt": {
|
|
2024 | 2210 | "title": "MuxRule",
|
2025 | 2211 | "description": "Represents a mux rule for a provider."
|
2026 | 2212 | },
|
| 2213 | + "PaginatedMessagesResponse": { |
| 2214 | + "properties": { |
| 2215 | + "data": { |
| 2216 | + "items": { |
| 2217 | + "$ref": "#/components/schemas/ConversationSummary" |
| 2218 | + }, |
| 2219 | + "type": "array", |
| 2220 | + "title": "Data" |
| 2221 | + }, |
| 2222 | + "limit": { |
| 2223 | + "type": "integer", |
| 2224 | + "title": "Limit" |
| 2225 | + }, |
| 2226 | + "offset": { |
| 2227 | + "type": "integer", |
| 2228 | + "title": "Offset" |
| 2229 | + }, |
| 2230 | + "total": { |
| 2231 | + "type": "integer", |
| 2232 | + "title": "Total" |
| 2233 | + } |
| 2234 | + }, |
| 2235 | + "type": "object", |
| 2236 | + "required": [ |
| 2237 | + "data", |
| 2238 | + "limit", |
| 2239 | + "offset", |
| 2240 | + "total" |
| 2241 | + ], |
| 2242 | + "title": "PaginatedMessagesResponse" |
| 2243 | + }, |
2027 | 2244 | "Persona": {
|
2028 | 2245 | "properties": {
|
2029 | 2246 | "id": {
|
|
0 commit comments