From 0f1aac6c341586e3c68dde9866f027c926406e57 Mon Sep 17 00:00:00 2001 From: Peter Krenesky Date: Wed, 7 Feb 2024 19:52:45 -0800 Subject: [PATCH 1/2] Update the fixture for ix api for recent updates --- ix/data/fixtures/ix_api.json | 523 +++++++++++++++++++++++++++++------ 1 file changed, 439 insertions(+), 84 deletions(-) diff --git a/ix/data/fixtures/ix_api.json b/ix/data/fixtures/ix_api.json index 49979bad..99378100 100644 --- a/ix/data/fixtures/ix_api.json +++ b/ix/data/fixtures/ix_api.json @@ -1,64 +1,4 @@ [ -{ - "model": "data.schema", - "pk": "0d60a3ca-f5b6-48c7-8944-726053b0dba7", - "fields": { - "user": 1, - "group": null, - "type": "json", - "name": "CatMemeSchema", - "description": "JSON schema for cat memes", - "value": { - "type": "object", - "$schema": "http://json-schema.org/draft-07/schema#", - "required": [ - "id", - "image_url", - "caption" - ], - "properties": { - "id": { - "type": "string", - "description": "Unique identifier for the meme" - }, - "tags": { - "type": "array", - "items": { - "type": "string" - }, - "description": "List of tags associated with the meme" - }, - "caption": { - "type": "string", - "description": "Caption for the cat meme" - }, - "image_url": { - "type": "string", - "description": "URL of the cat meme image" - }, - "created_at": { - "type": "string", - "format": "date-time", - "description": "The date and time when the meme was created" - } - } - }, - "meta": {} - } -}, -{ - "model": "data.schema", - "pk": "4000023d-0f44-48b4-93a2-78ad95a3693c", - "fields": { - "user": 1, - "group": null, - "type": "json", - "name": "test", - "description": "testing schemas", - "value": {}, - "meta": {} - } -}, { "model": "data.schema", "pk": "55290ca3-ea37-4000-bdcf-bea6933ad3d9", @@ -524,6 +464,111 @@ } } }, + "/skills/": { + "get": { + "tags": [ + "Skills" + ], + "summary": "Get Skills", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/SkillPage" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "parameters": [ + { + "in": "query", + "name": "limit", + "schema": { + "type": "integer", + "title": "Limit", + "default": 10 + }, + "required": false + }, + { + "in": "query", + "name": "offset", + "schema": { + "type": "integer", + "title": "Offset", + "default": 0 + }, + "required": false + } + ], + "operationId": "get_skills", + "requestBody": { + "content": { + "application/json": { + "schema": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Tags" + } + } + } + } + }, + "post": { + "tags": [ + "Skills" + ], + "summary": "Create Skill", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Skill" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "operationId": "create_skill", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditSkill" + } + } + }, + "required": true + } + } + }, "/upload/": { "post": { "summary": "Upload File", @@ -660,7 +705,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/NewSchema" + "$ref": "#/components/schemas/EditSchema" } } }, @@ -1895,6 +1940,139 @@ "operationId": "delete_chain" } }, + "/skills/{skill_id}": { + "get": { + "tags": [ + "Skills" + ], + "summary": "Get Skill", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Skill" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "parameters": [ + { + "in": "path", + "name": "skill_id", + "schema": { + "type": "string", + "title": "Skill Id", + "format": "uuid" + }, + "required": true + } + ], + "operationId": "get_skill" + }, + "put": { + "tags": [ + "Skills" + ], + "summary": "Update Skill", + "responses": { + "200": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/Skill" + } + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "parameters": [ + { + "in": "path", + "name": "skill_id", + "schema": { + "type": "string", + "title": "Skill Id", + "format": "uuid" + }, + "required": true + } + ], + "operationId": "update_skill", + "requestBody": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/EditSkill" + } + } + }, + "required": true + } + }, + "delete": { + "tags": [ + "Skills" + ], + "summary": "Delete Skill", + "responses": { + "200": { + "content": { + "application/json": { + "schema": {} + } + }, + "description": "Successful Response" + }, + "422": { + "content": { + "application/json": { + "schema": { + "$ref": "#/components/schemas/HTTPValidationError" + } + } + }, + "description": "Validation Error" + } + }, + "parameters": [ + { + "in": "path", + "name": "skill_id", + "schema": { + "type": "string", + "title": "Skill Id", + "format": "uuid" + }, + "required": true + } + ], + "operationId": "delete_skill" + } + }, "/schemas/{schema_id}": { "get": { "tags": [ @@ -1981,7 +2159,7 @@ "content": { "application/json": { "schema": { - "$ref": "#/components/schemas/Schema" + "$ref": "#/components/schemas/EditSchema" } } }, @@ -3923,6 +4101,72 @@ } } }, + "Skill": { + "type": "object", + "title": "Skill", + "required": [ + "name", + "code" + ], + "properties": { + "id": { + "type": "string", + "title": "Id", + "format": "uuid4", + "description": "ID. Do not set when creating or updating" + }, + "code": { + "type": "string", + "title": "Code" + }, + "name": { + "type": "string", + "title": "Name", + "maxLength": 128 + }, + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Tags" + }, + "func_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Func Name" + }, + "description": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Description" + }, + "input_schema": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Input Schema" + } + }, + "description": "JSON and OpenAPI schemas" + }, "Choice": { "type": "object", "title": "Choice", @@ -4644,44 +4888,106 @@ }, "description": "A connection point for a property on a node." }, - "NewSchema": { + "EditSkill": { "type": "object", - "title": "NewSchema", + "title": "EditSkill", "required": [ - "type", "name", - "description" + "code" ], "properties": { - "meta": { - "type": "object", - "title": "Meta", - "description": "schema metadata as a dict" + "code": { + "type": "string", + "title": "Code" }, "name": { "type": "string", "title": "Name", "maxLength": 128 }, - "type": { - "enum": [ - "json", - "openapi" - ], - "type": "string", - "title": "Type" + "tags": { + "type": "array", + "items": { + "type": "string" + }, + "title": "Tags" }, - "value": { - "type": "object", - "title": "Value", - "description": "schema as a dict" + "func_name": { + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], + "title": "Func Name" }, "description": { - "type": "string", + "anyOf": [ + { + "type": "string" + }, + { + "type": "null" + } + ], "title": "Description" + }, + "input_schema": { + "anyOf": [ + { + "type": "object" + }, + { + "type": "null" + } + ], + "title": "Input Schema" } }, - "description": "New schema definition" + "description": "New or updated skill definition" + }, + "SkillPage": { + "type": "object", + "title": "SkillPage", + "required": [ + "page_number", + "pages", + "count", + "has_next", + "has_previous", + "objects" + ], + "properties": { + "count": { + "type": "integer", + "title": "Count" + }, + "pages": { + "type": "integer", + "title": "Pages" + }, + "objects": { + "type": "array", + "items": { + "$ref": "#/components/schemas/Skill" + }, + "title": "Objects" + }, + "has_next": { + "type": "boolean", + "title": "Has Next" + }, + "page_number": { + "type": "integer", + "title": "Page Number" + }, + "has_previous": { + "type": "boolean", + "title": "Has Previous" + } + } }, "ChatUpdate": { "type": "object", @@ -4769,6 +5075,45 @@ } } }, + "EditSchema": { + "type": "object", + "title": "EditSchema", + "required": [ + "type", + "name", + "description" + ], + "properties": { + "meta": { + "type": "object", + "title": "Meta", + "description": "schema metadata as a dict" + }, + "name": { + "type": "string", + "title": "Name", + "maxLength": 128 + }, + "type": { + "enum": [ + "json", + "openapi" + ], + "type": "string", + "title": "Type" + }, + "value": { + "type": "object", + "title": "Value", + "description": "schema as a dict" + }, + "description": { + "type": "string", + "title": "Description" + } + }, + "description": "New schema definition" + }, "FieldGroup": { "type": "object", "title": "FieldGroup", @@ -4978,7 +5323,9 @@ "title": "UpdateEdge", "required": [ "source_id", - "target_id" + "target_id", + "target_key", + "source_key" ], "properties": { "source_id": { @@ -4990,6 +5337,14 @@ "type": "string", "title": "Target Id", "format": "uuid" + }, + "source_key": { + "type": "string", + "title": "Source Key" + }, + "target_key": { + "type": "string", + "title": "Target Key" } } }, From fbda313b32463f0aba0b875c66d0689e8153a2a8 Mon Sep 17 00:00:00 2001 From: Peter Krenesky Date: Wed, 7 Feb 2024 19:53:46 -0800 Subject: [PATCH 2/2] SkillForge and SchemaForge were not linked to the IX schema defined in the fixture --- ix/chains/fixtures/agent/schemas.json | 8 ++++---- ix/chains/fixtures/agent/skills.json | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/ix/chains/fixtures/agent/schemas.json b/ix/chains/fixtures/agent/schemas.json index 6d271330..e5dff0b0 100644 --- a/ix/chains/fixtures/agent/schemas.json +++ b/ix/chains/fixtures/agent/schemas.json @@ -40,7 +40,7 @@ "method": "get", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d" + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9" }, "name": "get_schemas", "description": "Get Schemas", @@ -65,7 +65,7 @@ "method": "post", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d" + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9" }, "name": "create_schema", "description": "Create Schema:\n- value is the actual json schema, you must define this.\n- meta must be a dict. it stores key:value tags in the dict. Must be {} if no tags.\n- create json schema by default.", @@ -118,7 +118,7 @@ "method": "put", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d" + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9" }, "name": "update_schema", "description": "Update Schema:\n- value is the actual json schema, you must reuse or define this.\n- meta must be a dict. it stores key:value tags in the dict. Must be {} if no tags.\n", @@ -168,7 +168,7 @@ "method": "get", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d" + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9" }, "name": "get_schema", "description": "Get Schema", diff --git a/ix/chains/fixtures/agent/skills.json b/ix/chains/fixtures/agent/skills.json index 76204936..61cf9b10 100644 --- a/ix/chains/fixtures/agent/skills.json +++ b/ix/chains/fixtures/agent/skills.json @@ -72,7 +72,7 @@ "method": "put", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d", + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9", "instructions": "- Search for skill before trying to fetch it. \n- copy all field values in update data except: \"id\"\n\n- code is python with type hinting\n- code must include at least one function\n- code function args must have type hints\n- code function must have a docstring\n- input_schema is null\n- func_name is null\n- tags must be a list. [] if no values.\n\nShow your work after." }, "name": "update_skill", @@ -99,7 +99,7 @@ "prompt": "Create a new skill:\n- input_schema is null\n- func_name is null\n- skill.code is the code for a single python function\n- function must have type hints\n- function must have a docstring", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d" + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9" }, "name": "get_skills", "description": "Get Skills", @@ -124,7 +124,7 @@ "method": "get", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d", + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9", "instructions": "- Search for skill before trying to fetch it. \n- skill_id is required" }, "name": "get_skill", @@ -150,7 +150,7 @@ "method": "delete", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d" + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9" }, "name": "delete_skill", "description": "Delete Skill", @@ -254,7 +254,7 @@ "prompt": "Create a new skill:\n- code is python with type hinting\n- input_schema is null\n- func_name is null\n- code must include at least one function\n- code function args must have type hints\n- code function must have a docstring", "server": "http://172.17.0.1:8000/api", "headers": {}, - "schema_id": "67dcf17e-1464-48bd-ae94-2184b7ab6a0d", + "schema_id": "55290ca3-ea37-4000-bdcf-bea6933ad3d9", "instructions": "Create a new skill:\n-write only python with type hinting\n- code must include at least one function\n- code function args must have type hints\n- code function must have a docstring\n- input_schema is null\n- func_name is null\n\nShow your work after." }, "name": "create_skill",