From 30dc2a66b8169291bbecf689986810ee7d35104c Mon Sep 17 00:00:00 2001 From: Cyber MacGeddon Date: Wed, 20 Nov 2024 19:12:40 +0000 Subject: [PATCH] Put API tests in a subdir --- test-api | 68 ------------------- test-agent-api => test-api/test-agent-api | 0 .../test-embeddings-api | 0 .../test-graph-rag-api | 0 test-llm-api => test-api/test-llm-api | 0 test-prompt-api => test-api/test-prompt-api | 0 test-prompt2-api => test-api/test-prompt2-api | 0 .../test-triples-query-api | 0 8 files changed, 68 deletions(-) delete mode 100755 test-api rename test-agent-api => test-api/test-agent-api (100%) rename test-embeddings-api => test-api/test-embeddings-api (100%) rename test-graph-rag-api => test-api/test-graph-rag-api (100%) rename test-llm-api => test-api/test-llm-api (100%) rename test-prompt-api => test-api/test-prompt-api (100%) rename test-prompt2-api => test-api/test-prompt2-api (100%) rename test-triples-query-api => test-api/test-triples-query-api (100%) diff --git a/test-api b/test-api deleted file mode 100755 index 29b05ab1..00000000 --- a/test-api +++ /dev/null @@ -1,68 +0,0 @@ -#!/usr/bin/env python3 - -import requests -import json -import sys - -url = "http://localhost:8088/api/v1/" - -############################################################################ - -input = { - "system": "Respond in French. Use long word, form of numbers, no digits", -# "prompt": "Add 2 and 12" - "prompt": "Add 12 and 14, and then make a poem about llamas which incorporates that number. Then write a joke about llamas" -} - -resp = requests.post( - f"{url}text-completion", - json=input, -) - -resp = resp.json() - -if "error" in resp: - print(f"Error: {resp['error']}") - sys.exit(1) - -print(resp["response"]) - -############################################################################ - -input = { - "id": "question", - "variables": { - "question": "Write a joke about llamas." - } -} - -resp = requests.post( - f"{url}prompt", - json=input, -) - -if "error" in resp: - print(f"Error: {resp['error']}") - sys.exit(1) - -print(resp["response"]) - -sys.exit(0) -############################################################################ - -input = { - "id": "extract-definitions", - "variables": { - "text": "A cat is a large mammal." - } -} - -resp = requests.post( - f"{url}prompt", - json=input, -) - -print(json.dumps(resp.json()["object"], indent=4)) - -############################################################################ - diff --git a/test-agent-api b/test-api/test-agent-api similarity index 100% rename from test-agent-api rename to test-api/test-agent-api diff --git a/test-embeddings-api b/test-api/test-embeddings-api similarity index 100% rename from test-embeddings-api rename to test-api/test-embeddings-api diff --git a/test-graph-rag-api b/test-api/test-graph-rag-api similarity index 100% rename from test-graph-rag-api rename to test-api/test-graph-rag-api diff --git a/test-llm-api b/test-api/test-llm-api similarity index 100% rename from test-llm-api rename to test-api/test-llm-api diff --git a/test-prompt-api b/test-api/test-prompt-api similarity index 100% rename from test-prompt-api rename to test-api/test-prompt-api diff --git a/test-prompt2-api b/test-api/test-prompt2-api similarity index 100% rename from test-prompt2-api rename to test-api/test-prompt2-api diff --git a/test-triples-query-api b/test-api/test-triples-query-api similarity index 100% rename from test-triples-query-api rename to test-api/test-triples-query-api