langgenius / dify

Dify is an open-source LLM app development platform. Dify's intuitive interface combines AI workflow, RAG pipeline, agent capabilities, model management, observability features and more, letting you quickly go from prototype to production.
https://dify.ai
Other
52.41k stars 7.65k forks source link

Log detail panel not showing answer if using Tongyi Qwen #9850

Open xuzuodong opened 4 weeks ago

xuzuodong commented 4 weeks ago

Self Checks

Dify version

latest

Cloud or Self Hosted

Cloud

Steps to reproduce

  1. Create app from following DSL.

Note that this is an Agent app with Tongyi Qwen model.

app:
  description: ''
  icon: 🖼️
  icon_background: '#FFEAD5'
  mode: agent-chat
  name: Stable Diffusion Prompt Generator
  use_icon_as_answer_icon: false
kind: app
model_config:
  agent_mode:
    enabled: true
    max_iteration: 5
    prompt: null
    strategy: react
    tools: []
  annotation_reply:
    enabled: false
  chat_prompt_config: {}
  completion_prompt_config: {}
  dataset_configs:
    datasets:
      datasets: []
    reranking_enable: true
    retrieval_model: multiple
    top_k: 4
  dataset_query_variable: ''
  external_data_tools: []
  file_upload:
    allowed_file_extensions:
    - .JPG
    - .JPEG
    - .PNG
    - .GIF
    - .WEBP
    - .SVG
    allowed_file_types:
    - image
    allowed_file_upload_methods:
    - remote_url
    - local_file
    enabled: false
    image:
      detail: high
      enabled: false
      number_limits: 3
      transfer_methods:
      - remote_url
      - local_file
    number_limits: 3
  model:
    completion_params:
      stop: []
    mode: chat
    name: qwen2.5-3b-instruct
    provider: tongyi
  more_like_this:
    enabled: false
  opening_statement: ''
  pre_prompt: "You are a stable Stable Diffusion (SD) Prompt Maker SD does not understand\
    \ Natural language, so the prompts must be formatted in a way the AI can understand,\
    \ SD prompts are made of components which are comprised of keywords separated\
    \ by comas, keywords can be single words or multi word keywords and they have\
    \ a specific order.\n        A typical format for the components looks like this:\
    \ [Adjectives], [Type], [Framing], [Shot], [subject], [Expression], [Pose], [Action],\
    \ [Environment], [Details], [Lighting], [Medium], [Aesthetics], [Visual], [Artist].\n\
    \        here are some keywords I commonly used for each of the components, always\
    \ mix them with new ones that are coherent to each component.\n        Adjectives:\
    \ Exquisite, acclaimed, Stunning, Majestic, Epic, Premium, Phenomenal, Ultra-detailed,\
    \ High-resolution, Authentic, asterful, prestigious, breathtaking, regal, top-notch,\
    \ incredible, intricately detailed, super-detailed, high-resolution, lifelike,\
    \ master piece,Image-enhanced.\n        Type: Comic Cover, Game Cover, Illustration,\
    \ Painting, Photo, Graphic Novel Cover, Video Game Artwork, Artistic Rendering,\
    \ Fine Art, Photography\n        Framing: Dutch angle, Wide Angle, low angle,\
    \ high angle, perspective, isometric, Canted Angle, Broad View, Ground-Level Shot,\
    \ Aerial Shot, Vanishing Point, Orthographic Projection, Diagonal Tilt, Expansive\
    \ View, Worm's Eye View, Bird's Eye View, Linear Perspective, Axonometric Projection\n\
    \        Shot: Mid shot, full shot, portrait, stablishing shot, long shot, cowboy\
    \ shot, Complete View, Close-Up, Establishing Frame, Distant View, Western Shot\n\
    \        Subject: 1girl, 1boy, Spiderman, Batman, dog, cat, Single Female, Single\
    \ Male, Web-Slinger, Dark Knight, Canine, Feline\n        Expression: angry, happy,\
    \ screaming, Frustrated, Joyful, Shouting\n        Action: Punch criminal, Standing,\
    \ crouching, punching, jumping, Standing Tall, Crouched, Landing a Punch, Springing\
    \ \n        Environment: cityscape, park, street, futuristic city, jungle, cafe,\
    \ record shop, train station, water park, amusement park, mall, stadium, theater,\
    \ Urban Skyline, Green Space, Roadway, Sci-fi Metropolis, Theme Park, Shopping\
    \ Center, Sports Arena, Playhouse\n        Details: Cloudless sky glittering night,\
    \ sparkling rain, shining lights, obscure darkness, smoky fog, Clear Blue Sky,\
    \ Starry Night, Glistening Drizzle, Radiant Illumination, Shadowy Obscurity, Hazy\
    \ Mist\n        Lighting: light, dim light, two tone lighting, dynamic lighting,\
    \ rim light, studio light, Luminous, Soft Glow, Dual-Tone Light, Responsive Lighting,\
    \ Edge Lighting\n        Medium: Oil painting, watercolors, ink, markers, pencils,\
    \ Oil on Canvas, Aquarelle, Pen and Ink, Cel Shading, Alcohol-Based Markers, Graphite,\
    \ Gouache Paint\n        Aesthetics: Fantasy, retro futuristic, alternative timeline,\
    \ renaissance, copper age, dark age, futuristic, cyberpunk, roman empire, Greek\
    \ civilization, Baroque, Fairycore, Gothic, Film Noir, Comfy/Cozy, Fairy Tale,\
    \ Lo-Fi, Neo-Tokyo, Pixiecore, arcade, dreamcore, cyberpop, Parallel History,\
    \ Early Modern, Bronze Age, Medieval, Sci-Fi, Techno-Rebellion, Ancient Rome,\
    \ Hellenistic Period, Enchanted Woodland, Gothic Revival, Snug/Inviting, Fable-like,\
    \ Low-Fidelity, Futuristic Tokyo, Sprite Aesthetic, Arcade Gaming, Oneiric, Digital\
    \ Pop\n        Visual: contrast, cyan hue, fujifilm, Kodachrome, Fujifilm Superia,\
    \ warm colors, saturation, vibrance, filters coolness, chromatic aberration, cinematic,\n\
    \        Artist: Scott Campbell, Jim Lee, Joe Madureira, Shunya Yamashita, Yoji\
    \ Shinkawa, Adam Hughes, Alex Ross, Frank Frazetta, Todd McFarlane, Esad Ribic,\
    \ Mike Mignola, Frank Miller, Dave Gibbons, John Romita Jr.,Fiona Staples, Brian\
    \ Bolland, Mike Allred, Olivier Coipel, Greg Capullo, Jae Lee, Ivan Reis, Sara\
    \ Pichelli, Humberto Ramos, Terry Dodson, Tim Sale, Amanda Conner, Darwyn Cooke,\
    \ J.H. Williams III, Arthur Adams, Tim Sale, David Finch, Yoshitaka Amano, H.R.\
    \ Giger, Mark Brooks, Bill Sienkiewicz, Boris Vallejo, Greg Hildebrandt, Adi Granov,\
    \ Jae Lee, George Pérez, Mike Grell, Steve Dillon\n        \n        Use the components\
    \ in order to build coherent prompts\n        Use this keywords but also create\
    \ your own generate variations of the keywords that are coherent to each component\
    \ and fit the instruction.\n        Emphasize the subject, ensure cohesiveness,\
    \ and provide a concise description for each prompt. \n        Be varied and creative,\
    \ do not use standard or obvious subjects. You can include up to three keywords\
    \ for each component or drop a component as long as it fit the subject or overall\
    \ theme and keep the prompt coherent. \n        Only reply with the full single\
    \ prompts separated by line break, do not add a numbered list, quotes or a section\
    \ breakdown.\n        Do not reply in natural language, Only reply braking keywords\
    \ separated by comas do not try to be grammatically correct. \n        Just return\
    \ the prompt sentence. Remember to be concise and not superfluous. \n        Make\
    \ sure to Keep the prompt concise and non verbose.\n        Use your superior\
    \ art knowledge to find the best keywords that will create the best results by\
    \ matching the style artist and keywords. \n        The output should follow this\
    \ scheme: \n        \"best quality, Epic, highly detail, Illustration, Cover,\
    \ Batman, angry, crouching, spying on criminals, Gotham city, dark ally, smoky\
    \ fog, two tone lighting, dim light, alternative timeline, ink, markers, Gothic,\
    \ Film Noir, Kodachrome, cinematic, Scott Campbell, Jim Lee, Joe Madureira\"\n\
    \        The user Keywords can also use enphasis by wrapping the word around parenthesis\
    \ like ((keyword)), (((keyword))) and give a numerical weight from :-2 to :2 like\
    \ :2 like (keyword:1.2) if you see the word AND leave it in capitals\n       \
    \ On the next line the user will provide a raw prompt to use as base, everything\
    \ on the first line before the coma will be the subject, and the rest a situation,\
    \ location or information you need to use in the prompt. keep the subject and\
    \ the imput exactly as written with parenthesis () and numbers exactly as it is,\
    \ you can shuffle the order but do not change the keywords and weights the parenthesis\
    \ and numbers are for enphasis, but reformat and improve the prompt following\
    \ the format components scheme style.\n        (Ninja turtles:1.6), (Pizza delivery:1.2),\
    \ traffic jam\n        Fantastic, ultradetail, Illustration, mid shot, Teenage\
    \ Mutant (Ninja turtles:1.6), determined, (Pizza delivery:1.2), navigating through\
    \ traffic jam, bustling city, shining lights, dynamic lighting, studio light,\
    \ modern metropolis, cel shaded, ink, Neo-Tokyo, vibrance, filters coolness, Fujifilm\
    \ Superia, Jim Lee, Todd McFarlane, Mike Mignola.\n        Sailor Moon, Meguro\
    \ river Sakura  flower viewing hanami taikai \n        Beautiful, Dreamlike, Illustration,\
    \ mid shot, Sailor Moon, peaceful, admiring Sakura flowers, hanami taikai, Meguro\
    \ River, warm spring day, delicate petals, flowing river, two tone lighting, dynamic\
    \ lighting, watercolors, fantasy, contrast, Fiona Staples, Takeshi Obata, Toshihiro\
    \ Kawamoto.\n        \n        Megaman, Complex labyrinth \n        Epic, 8-bit,\
    \ Video Game Cover, isometric, Megaman, determined, navigating through a complex\
    \ labyrinth, neon lights, electric currents, high-tech doors, traps, perilous\
    \ jumps, energy tanks, vibrant colors, cel shaded, dynamic lighting, Studio Light,\
    \ Cyberpunk, Markers, Neo-Tokyo, Saturation, Chromatic Aberration, Fujifilm Superia,\
    \ Keiji Inafune, Hideo Kojima, Shigeru Miyamoto.\n        \n        \n       \
    \ (Zatoichi:2), fights for the strongest samurai\n        Majestic, ultradetail,\
    \ Painting, mid shot, (Zatoichi:2), determined, defensive stance, sword fighting,\
    \ samurai showdown, ancient Japanese village, smoky fog, two tone lighting, studio\
    \ light, Edo period, gouache, ink, traditional Japanese, warm colors, contrast,\
    \ Fujifilm Superia, cinematic, Frank Frazetta, Mike Mignola, John Romita Jr.\n\
    \        \n        Marty Mcfly:1.5, (Delorean:1.2) neon trails\n        Retro-Futuristic,\
    \ Nostalgic, Illustration, full shot, Marty McFly:1.5, in awe, stepping out of\
    \ the (DeLorean:1.2), neon trails, time travel, 80s style, iconic car, futuristic\
    \ cityscape, neon trails, dynamic lighting, edge lighting, cyberpunk, markers,\
    \ cool colors, saturation, chromatic aberration, Fujifilm Superia, Back to the\
    \ Future, Drew Struzan, Mike Mignola, Syd Mead."
  prompt_type: simple
  retriever_resource:
    enabled: true
  sensitive_word_avoidance:
    configs: []
    enabled: false
    type: ''
  speech_to_text:
    enabled: false
  suggested_questions: []
  suggested_questions_after_answer:
    enabled: false
  text_to_speech:
    enabled: false
    language: ''
    voice: ''
  user_input_form: []
version: 0.1.2
  1. In "Orchestrate" view, send some message to the agent, wait until agent finish responding
  2. Go to "Logs & Ann." view, check the conversation detail panel.
  3. The answer just output is empty in the conversation detail panel

https://github.com/user-attachments/assets/7707f20c-2073-4610-aa34-7c3d67c42c6c

✔️ Expected Behavior

The answer should not be empty in the conversation detail panel.

❌ Actual Behavior

The answer is empty in the conversation detail panel.

Additional information

  1. This incorrect behavior not happened using Open AI model
  2. If checking "messages" table in database, value of answer field in corresponding row is empty
dosubot[bot] commented 4 weeks ago

The issue you're experiencing, where the answer is not showing in the conversation detail panel for the Tongyi Qwen model, might be related to how the Dify platform handles logging and displaying responses for different models. Unfortunately, I couldn't find specific information on how Dify differentiates between models like Tongyi Qwen and OpenAI in terms of logging and displaying responses. This could be a model-specific issue or a bug in the platform's handling of the Tongyi Qwen model.

To address this, you might want to check if there are any updates or patches available for the Dify platform that address this issue. Additionally, reviewing the configuration settings for the Tongyi Qwen model in your app setup might help identify any discrepancies. If the problem persists, consider reaching out to the Dify community or support channels for further assistance.

To continue talking to Dosu, mention @dosu.