Skip to content

feat: add AI/ML API integration - #108

Open
Lookoff-AIMLAPI wants to merge 1 commit into
chatwoot:mainfrom
aimlapi:feat/aimlapi-tools
Open

Lookoff-AIMLAPI wants to merge 1 commit into
chatwoot:mainfrom
aimlapi:feat/aimlapi-tools

Conversation

@Lookoff-AIMLAPI

Copy link
Copy Markdown

Summary

Adds aimlapi/ to the Captain tools catalog in Business data & research, with three read-only tools:

  • Search Web (search_web): web search through tavily/search.
  • Read Web Page (read_web_page): page Markdown through mrscraper/scrape-markdown.
  • Take Screenshot (take_screenshot): a page screenshot through dataforseo/onpage-page-screenshot.

All three use one API key via Bearer authentication and the literal endpoint https://tools.aimlapi.com/v1/tools/run. API reference: https://tools.aimlapi.com/docs. Runs are billed to the AI/ML API account that owns the key.

Includes setup documentation, a logo, a root README table entry, and an empty AIMLAPI_API_KEY in .env.example. Request bodies escape call-time values using the context-dev/toolset.yml pattern; response templates include an unexpected-response fallback.

Testing

  • python3 .github/scripts/validate_manifests.py */toolset.yml: 7/7 valid, 0 invalid (baseline on main: 6/6 valid, 0 invalid).
  • ruby tool-tester.rb aimlapi --dry-run: all 3 tools render valid JSON, including inputs containing quotes and backslashes.
  • Real API checks:
    • ruby tool-tester.rb aimlapi, selecting search_web with Chatwoot Captain custom tools: HTTP 200, 3559 ms, 8.1 KB, 5 results rendered.
    • ruby tool-tester.rb aimlapi read_web_page with https://example.com: HTTP 200, 5771 ms, Markdown rendered.
    • ruby tool-tester.rb aimlapi take_screenshot with https://example.com: HTTP 200, 14455 ms, image link rendered.
    • search_web with site:invalid: HTTP 200, 2057 ms, upstream provider error in the body; the fallback AI/ML API returned an unexpected response. was rendered.
  • search_web empty results: Tavily returned loose matches for every nonsense query tried live (6 queries), so the No results found. branch was checked through tool-tester.rb against a local endpoint returning a completed response with output.results: []. The tester rendered No results found., and the request body sent matches the one sent to the real API.

Captain has a 20-second request limit; the screenshot check took about 14.5 seconds.

@sokolova-1

Copy link
Copy Markdown

Hi @scmmishra, I'm Alisa, DevRel lead at AI/ML API (the PR was opened by our team). It's ready for review whenever you have a moment. Happy to adjust anything the Chatwoot team needs. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants