LogoLogo
  • Moonveil Image Creation API
    • Create Images
    • Redraw Image
    • Expand Prompt
    • Image to Prompt
    • Get Image Generation Result
    • Retrieve Image History
    • Retrieve Image Costs
    • Retrieve Image Metrics
    • Retrieve Recharge History
    • Export Image as SVG
    • Retrieve Credit
  • GenAI Factory API
    • Create Task
    • Get Task Status
    • Upload Multiple Images
    • Create Asset
    • Get All User Assets
    • Get a Single Asset
    • Update Asset Description
    • Delete an Asset
  • Agent API
    • Start Conversation
    • Continue Conversation
    • Retrieve Conversation History
    • Retrieve All Sessions
    • Delete Conversation by Session ID
Powered by GitBook
On this page

Was this helpful?

Export as PDF
  1. Agent API

Start Conversation

API Endpoint

POST https://api.genaifactory.ai/v1/start_conversation

Headers

Name
Type
Required
Description

formacloud-api-key

string

Yes

API key for authentication

Request Body

Name
Type
Required
Description

goal

string

Yes

The goal or topic of the conversation

session_id

string

No

An optional session ID (auto-generated if empty)

Example Request

curl --location 'https://api.genaifactory.ai/v1/start_conversation' \
--header 'formacloud-api-key: abc123' \
--header 'Content-Type: application/json' \
--data '{
    "goal":"Ask the user what he/she wants, and help them create it.",
    "session_id":"shuxuan-test-1"
}'

Response

Returns a JSON object containing session details and the first conversation step.

Field
Type
Description

session_id

string

Unique session identifier

current_step

object

The current step in the conversation

Example Response

{
    "current_step": {
        "agent_response": {
            "action": "AskUser",
            "parameters": {
                "question": "Hello! I'm here to help you create something amazing. What would you like to create today? I can help with:\n\n1. Creating images from text descriptions\n2. Converting images to short videos\n3. Processing and analyzing images\n4. Creating HTML visualizations\n\nPlease let me know what you have in mind, and I'll help plan and execute it step by step!"
            },
            "reasoning": "Since this is the start of our interaction and there's no specific request yet in the history, I should first understand what the user wants to create. As a master planner, I need to gather initial requirements before proposing any specific approach.",
            "selected_tool": ""
        },
        "id": 0,
        "step_result": null,
        "timestamp": "2025-02-21T04:13:24.128311+00:00"
    },
    "session_id": "shuxuan-test-1"
}

Last updated 4 months ago

Was this helpful?