Skip to content
Merged
Show file tree
Hide file tree
Changes from 7 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 0 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,6 @@ bundle: plugins/$(FULL_PLUGIN_NAME).so
test_plugin:
curl -vv http://localhost:8080/httpbin_tyk/json -H "X-Nl-Query-Enabled: yes" -H "X-Nl-Response-Type: nl" -H "Content-Type: text/plain" -d "Hello"

load_plugin_select: configs/httpbin.org.api-selection.json tyk-release-$(TYK_VERSION)/middleware/agent-bridge-plugin.so
curl http://localhost:8080/tyk/apis/oas --header "x-tyk-authorization: foo" --header 'Content-Type: text/plain' -d@configs/httpbin.org.api-selection.json && sleep 3
curl http://localhost:8080/tyk/reload/group --header "x-tyk-authorization: foo"

test_plugin_select: configs/httpbin.org.api-selection.json tyk-release-$(TYK_VERSION)/middleware/agent-bridge-plugin.so
curl -vv 'http://localhost:8080/httpbin_select/?query=I%20would%20like%20an%20XML%20response.' --header 'Content-Type: text/plain'

download_models_for_semrouter:
ifeq (,$(wildcard ./tyk-release-$(TYK_VERSION)/models/jina-embeddings-v2-base-en-q5_k_m.gguf))
mkdir -p "tyk-release-$(TYK_VERSION)/models"
Expand Down
93 changes: 87 additions & 6 deletions configs/api-bridge-agent.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,23 +12,30 @@
},
"server": {
"listenPath": {
"value": "/aba/",
"strip": true
"value": "/api-bridge-agent/",
"strip": false
}
},
"middleware": {
"global": {
"pluginConfig": {
"data": {
"enabled": true,
"value": {}
"value": {
"mcpServers": {
"ddg": {
"command": "uvx",
"args": ["duckduckgo-mcp-server"]
}
}
}
},
"driver": "goplugin"
},
"prePlugins": [
{
"enabled": true,
"functionName": "ProcessACPQuery",
"functionName": "APIBridgeAgent",
"path": "middleware/agent-bridge-plugin.so"
}
]
Expand All @@ -47,9 +54,83 @@
}
],
"paths": {
"/": {
"/info": {
"get": {
"summary": "API Bridge Agent Information",
"responses": {
"200": {
"description": "",
"content": {}
}
}
}
},
"/nlq": {
"post": {
"summary": "Ask a natural language query question. Will use OpenAPI services or MCP servers",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "NLQ Response.",
"content": {}
}
}
}
},
"/openapis": {
"post": {
"summary": "Ask a natural language query question, only use configured OpenAPI services",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "NLQ Response.",
"content": {}
}
}
}
},
"/mcp/init": {
"post": {
"summary": "Initialize MCP servers",
"requestBody": {
"content": {
"text/plain": {
"schema": {
"type": "string"
}
}
},
"required": true
},
"responses": {
"200": {
"description": "MCP initialization state.",
"content": {}
}
}
}
},
"/mcp": {
"post": {
"summary": "Ask a natural language query question",
"summary": "Call an MCP server from a natural language query",
"requestBody": {
"content": {
"text/plain": {
Expand Down
9 changes: 2 additions & 7 deletions configs/api.github.com.gist.deref.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@
"postPlugins": [
{
"enabled": true,
"functionName": "SelectAndRewrite",
"path": "middleware/agent-bridge-plugin.so"
},
{
"enabled": true,
"functionName": "RewriteQueryToOas",
"functionName": "APIBridgeAgent",
"path": "middleware/agent-bridge-plugin.so"
}
],
"responsePlugins": [
{
"enabled": true,
"functionName": "RewriteResponseToNl",
"functionName": "APIBridgeAgentResponse",
"path": "middleware/agent-bridge-plugin.so"
}
]
Expand Down
9 changes: 2 additions & 7 deletions configs/api.sendgrid.com.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@
"postPlugins": [
{
"enabled": true,
"functionName": "SelectAndRewrite",
"path": "middleware/agent-bridge-plugin.so"
},
{
"enabled": true,
"functionName": "RewriteQueryToOas",
"functionName": "APIBridgeAgent",
"path": "middleware/agent-bridge-plugin.so"
}
],
"responsePlugins": [
{
"enabled": true,
"functionName": "RewriteResponseToNl",
"functionName": "APIBridgeAgentResponse",
"path": "middleware/agent-bridge-plugin.so"
}
]
Expand Down
9 changes: 2 additions & 7 deletions configs/gmail.googleapis.com.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,19 +29,14 @@
"postPlugins": [
{
"enabled": true,
"functionName": "SelectAndRewrite",
"path": "middleware/agent-bridge-plugin.so"
},
{
"enabled": true,
"functionName": "RewriteQueryToOas",
"functionName": "APIBridgeAgent",
"path": "middleware/agent-bridge-plugin.so"
}
],
"responsePlugins": [
{
"enabled": true,
"functionName": "RewriteResponseToNl",
"functionName": "APIBridgeAgentResponse",
"path": "middleware/agent-bridge-plugin.so"
}
]
Expand Down
103 changes: 0 additions & 103 deletions configs/httpbin.org.api-selection.json

This file was deleted.

10 changes: 2 additions & 8 deletions configs/httpbin.org.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,20 +28,14 @@
"postPlugins": [
{
"enabled": true,
"functionName": "SelectAndRewrite",
"functionName": "APIBridgeAgent",
"path": "middleware/agent-bridge-plugin.so"
},
{
"enabled": true,
"functionName": "RewriteQueryToOas",
"path": "middleware/agent-bridge-plugin.so",
"require_session": true
}
],
"responsePlugins": [
{
"enabled": true,
"functionName": "RewriteResponseToNl",
"functionName": "APIBridgeAgentResponse",
"path": "middleware/agent-bridge-plugin.so"
}
]
Expand Down
9 changes: 2 additions & 7 deletions configs/your-domain.atlassian.net.oas.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,14 @@
"postPlugins": [
{
"enabled": true,
"functionName": "SelectAndRewrite",
"path": "middleware/agent-bridge-plugin.so"
},
{
"enabled": true,
"functionName": "RewriteQueryToOas",
"functionName": "APIBridgeAgent",
"path": "middleware/agent-bridge-plugin.so"
}
],
"responsePlugins": [
{
"enabled": true,
"functionName": "RewriteResponseToNl",
"functionName": "APIBridgeAgentResponse",
"path": "middleware/agent-bridge-plugin.so"
}
]
Expand Down
Loading
Loading