Retrieve Conversation History
Session
API Endpoint
GET https://api.genaifactory.ai/v1/conversation_history/{session_id}
Headers
Name
Type
Required
Description
formacloud-api-key
string
Yes
API key for authentication
Query Parameters
Name
Type
Required
Description
last_step_only
boolean
No
If true
, returns only the last step
page
int
No
Page number (default: 0)
page_size
int
No
Number of steps per page (default: 10, max: 25)
Example Request
curl --location 'https://api.genaifactory.ai/v1/conversation_history/shuxuan-test-1?page=0&page_size=10' \
--header 'formacloud-api-key: abc123'
Response
Returns a JSON object containing the conversation history.
Field
Type
Description
session_id
string
Unique session identifier
goal
string
The goal of the conversation
steps
array
List of conversation steps
pagination
object
Pagination details
Example Response
{
"goal": "Ask the user what he/she wants, and help them create it.",
"pagination": {
"current_page": 0,
"total_pages": 1,
"total_records": 3
},
"session_id": "shuxuan-test-1",
"steps": [
{
"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": "create a dog image",
"timestamp": "2025-02-21T04:13:24.128311+00:00"
},
{
"agent_response": {
"action": "AskUser",
"parameters": {
"question": "I'll help you create a wonderful dog picture! To make sure I generate exactly what you're looking for, could you please provide more details about:\n\n1. What breed of dog would you like? (e.g., Golden Retriever, Corgi, etc.)\n2. What should the dog be doing? (e.g., sitting, playing, sleeping)\n3. What kind of setting or background would you prefer? (e.g., park, home, beach)\n4. Any specific style you'd like? (e.g., realistic, cartoon, artistic)\n\nThis will help me create the perfect dog picture for you!"
},
"reasoning": "The user wants to create a dog picture. Since we have access to the 'generate_image_by_recraft' tool that can create images from text descriptions, I should first get more specific details about what kind of dog picture they want to create to ensure the best results. This aligns with being a perfectionist and ensuring we create exactly what they envision.",
"selected_tool": ""
},
"id": 1,
"step_result": "a playing dog",
"timestamp": "2025-02-21T04:14:17.644225+00:00"
},
{
"agent_response": {
"action": "CallTool",
"parameters": {
"prompt": "A joyful and energetic dog playing outdoors, captured mid-action with a wagging tail and happy expression. The dog is jumping playfully with a bouncy, enthusiastic pose. Bright, cheerful lighting with a natural background. The image should convey happiness and movement, with the dog showing clear signs of enjoyment like a wide doggy smile and alert, excited eyes. High quality, detailed, vibrant colors."
},
"reasoning": "The user wants to create a picture of a playful dog. Since we want to create the best possible image, I should use the generate_image_by_recraft tool with a detailed prompt that captures a playful, energetic scene. I'll focus on creating a prompt that emphasizes the dog's playful nature and dynamic movement to make the image engaging and lively.",
"selected_tool": "generate_image_by_recraft"
},
"id": 2,
"step_result": "https://cdn.genaifactory.ai/gen_ai_factory/temp/image/2025/2/21/b9a62524b436468d9eaa106c986e84e9.png",
"timestamp": "2025-02-21T04:15:10.998182+00:00"
}
]
}
Last updated
Was this helpful?