Prerequisites

  1. Ensure the API server is running and accessible at http://localhost:8001.
  2. Have curl installed on your machine to execute the API requests.

Step 1: Logging in to get a bearer token

curl -X 'POST' \
  'http://localhost:8001/api/v1/login' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "email": "string",
  "password": "string"
}'

Step 2: Submit a Parsing Request

Replace the repo name and branch name with the repo you want to talk to.

curl -X 'POST' \
  'http://localhost:8001/api/v1/parse' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "repo_name": "vineetshar/mongo-proxy12",
  "branch_name": "main"
}'

Step 3: Check Parsing Status

Use the project id generated from previous request.

curl -X 'GET' \
  'http://localhost:8001/api/v1/parsing-status/project-id' \
  -H 'accept: application/json'

Step 4: List Available Agents

curl -X 'GET' \
  'http://localhost:8001/api/v1/list-available-agents/?list_system_agents=true' \
  -H 'accept: application/json'

Step 5: Create a Conversation

curl -X 'POST' \
  'http://localhost:8001/api/v1/conversations/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "user_id": "your_user_id",
  "title": "Conversation Title",
  "status": "active",
  "project_ids": [
    "project_id"
  ],
  "agent_ids": [
    "agent_id"
  ]
}'

Step 6: Send Messages in a Conversation

This API returns a stream response for the

curl -X 'POST' \
  'http://localhost:8001/api/v1/conversations/1234/message/' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d '{
  "content": "Your message content here",
  "node_ids": [
    {
      "node_id": "node_identifier",
      "name": "node_name"
    }
  ]
}'

Step 7: Get all the messages of a conversation

curl -X 'GET' \
  'http://localhost:8001/api/v1/conversations/conversation-id/
  messages/?start=0&limit=10' \
  -H 'accept: application/json'

Summary

  1. Submit a Parsing Request: Initiate parsing of a repository.
  2. Check Parsing Status: Monitor the progress until parsing is complete.
  3. List Available Agents: Retrieve agents to interact with.
  4. Create a Conversation: Start a new conversation session.
  5. Send Messages: Communicate within the created conversation.