Skip to main content

Ask a coding agent to add chat to your application

Section ID: Guide/jaii71cj4c#build-with-ai-coding-agents

Use a coding agent to add a working chat flow to an existing application: create a conversation, send a user's message and display its result. Give it the outcome and relevant contract, then review the integration against your application's authentication and user interface.

Before you start: identify the application's backend, signed-in user mechanism and chat screen. Obtain the credentials needed for a controlled test, and configure them through your development environment's secret mechanism rather than pasting them into a shared prompt.

Give the agent the references for this feature​

Section ID: Guide/jaii71cj4c#what-to-point-an-agent-at

Start with the documentation index and chat quickstart. Ask the agent to follow their links to the specific API operations it needs. Retrieve an additional guide when the feature needs it, such as file attachments or client tools.

Guide and API reference pages have plain Markdown copies: append .md to the route, for example https://docs.travila.ai/managed-agents/conversations/quickstart.md. API copies include request/response schemas and link to the downloadable OpenAPI contracts.

The combined documentation file includes selected guides and canonical API reference pages. Use it for a broader review when it fits the agent’s context; for this chat integration, the quickstart and selected operations are usually sufficient.

Describe the finished feature in the task prompt​

Section ID: Guide/jaii71cj4c#bootstrap-prompt

Adapt this task to your repository and chosen test environment:

Coding-assistant bootstrap prompt.

  • Add a chat feature to this application using Travila's current HTTP API.
  • Read https://docs.travila.ai/managed-agents/conversations/quickstart.md and follow its links
  • to the exact API reference. Use https://docs.travila.ai/llms.txt to find
  • additional guides only when this feature needs them.
  • Use our existing signed-in user flow. Keep backend secrets on the server.
  • Let the user create a conversation, send a message and see its completed
  • answer. Save the conversation identity so another message continues it.
  • Handle pending work and failures explicitly. After a lost response, recover
  • the original operation instead of automatically submitting another message.
  • Inspect our application structure before choosing files to change. Use the
  • existing design and error handling patterns. Do not invent API fields,
  • SDK packages or support for upcoming features. Identify any missing contract.
  • Verify one complete chat turn and one interrupted-request recovery case in
  • our controlled test environment, and report exactly what was verified.

Add your application's file locations and the user-visible behavior you expect. Keep credentials and unrelated customer conversations out of the prompt.

Review the generated integration against the real request​

Section ID: Guide/jaii71cj4c#conventions-agents-must-know

Check the prepared requests against the linked operation schemas before running them. The agent should use the application's authenticated user, keep the returned conversation and run identifiers, and interpret status rather than assuming every successful request contains an answer.

Let the generated API reference supply encoding and presence rules. In particular, do not allow the client to round large counters or treat an omitted value as a supported explicit setting. Use the API contract when reviewing those details.

Review the code diff and the external actions a test will perform. A coding agent reading documentation has not been authorized to access every connected account or send a message to a real recipient.

Verify that a customer can complete a conversation​

Section ID: Guide/jaii71cj4c#next-steps

Run the feature as your controlled application user. Create a conversation, send a message, wait for its actual outcome, and send a follow-up in the same conversation. Verify that the interface shows the intended answers and handles the interrupted-request case without duplicating the user's action.

Keep the result and any remaining failures with the code review. An agent's completion message or a compiling client does not prove the conversation works. Use integration testing for the rest of your application's acceptance cases.

For reusable packaged guidance, see the upcoming developer skills workflow.

Document ID: Guide/jaii71cj4c