- If ChatGPT produces AI-generated code for your app, who does it really belong to?
- The best iPhone power banks of 2024: Expert tested and reviewed
- The best NAS devices of 2024: Expert tested
- Four Ways to Harden Your Code Against Security Vulnerabilities and Weaknesses
- I converted this Windows 11 Mini PC into a Linux workstation - and didn't regret it
Cisco API Documentation Is Now Adapted for Gen AI
Developer experience changes rapidly. Many developers and the Cisco DevNet community utilize Generative AI tools and language models for code generation and troubleshooting.
Better data – better model completion
The main challenge for GenAI users is finding valid data for their prompts or Vector Databases. Developers and engineers need to care about the data they plan to use for LLMs/GenAI interaction.
OpenAPI documentations is now available to download
The OpenAPI documentation is a specification that defines a standard way to describe RESTful APIs, including endpoints, parameters, request/response formats, and authentication methods, promoting interoperability and ease of integration.
We at Cisco DevNet care about developers’ experience and want to make your experience working with Cisco APIs efficient and with minimal development/testing costs.
You can find links to OpenAPI documentation in JSON/YAML format here: Open API Documentation page and Search related product API – Navigate to API Reference -> Overview section in left-side menu
Note: Some API documentation can contain multiple OpenAPI Documents
For which purpose you can use related OpenAPI documentation as a part of prompt/RAG:
- Construct code or script that utilizes related Cisco API
- Find related API operations or ask to fix existing code using the information in the API documentation
- Create integrations with Cisco products through API
- Create and test AI agents
- Utilize related Cisco OpenAPI documentation locally or using approved AI tools in your organization.
Structured vs Unstructured data
I’ve compared two LLM model completions with a prompt that contains two parts.
The first part of the prompt was the same and contained the following information:
Based on the following API documentation, please write step-by-step instructions that can help automatically tag roaming computers using Umbrella API.
High-level workflow description:
- Add API Key
- Generate OAuth 2.0 access token
- Create tag
- Get the list of roaming computers and identify related ‘originId’
- Add tag to devices.
API documentation:
Second part:
- In one case, it contains copy and paste data directly from the doc,
- The other one contains LLM-friendly structured data like OpenAPI documents pasted one by one
Part of CDO OpenAPI documentation
Claude 3 Sonnet model completion. Prompt with OpenAPI documents
Claude 3 Sonnet model completion. Prompt with copy and paste data
Benefits of using LLM-friendly documentation as a part of the prompt
I’ve found that model output was more accurate when we used OpenAPI documents as a part of a prompt. API endpoints provided in each step were more accurate. Recommendations in sections like “Get List of Roaming Computers” contain better and more optimal instructions and API operations.
I’ve tested this with other foundational models, and model completion was more accurate when I used the OpenAPI document as a part of the prompt.
Some links on the Cisco APIs OpenAPI Documents
- https://developer.cisco.com/docs/cisco-defense-orchestrator/overview/
- https://developer.cisco.com/docs/cloud-security/token-overview/
- https://developer.cisco.com/docs/cisco-xdr/automation-api-guide/#sample-code
Share: