Skip to content

Add conversation is replying usage example - #809

Open
jasveena15 wants to merge 3 commits into
thoth-tech:mainfrom
jasveena15:doc/usage-example-conversation-is-replying
Open

Add conversation is replying usage example#809
jasveena15 wants to merge 3 commits into
thoth-tech:mainfrom
jasveena15:doc/usage-example-conversation-is-replying

Conversation

@jasveena15

Copy link
Copy Markdown

Description

This pull request adds a new SplashKit usage example for the conversation_is_replying function in the Generative AI category.

The example demonstrates how conversation_is_replying can be used to determine whether a language model is still generating a response. While the conversation is replying, the program continuously retrieves and displays each reply piece using conversation_get_reply_piece. Once the response is complete, the program displays a completion message.

The usage example has been implemented consistently across all supported languages:

  • C++
  • C# (Top-Level Statements)
  • C# (Object-Oriented)
  • Python

A descriptive title and an animated GIF demonstrating the streaming behaviour are also included.

No additional dependencies are required.

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation (update or new)

How Has This Been Tested?

The example was tested locally in all supported languages.

Testing performed:

  • Executed the Python example using SplashKit Manager.
  • Compiled and ran the C++ example successfully.
  • Tested both C# Top-Level Statements and Object-Oriented implementations.
  • Verified that conversation_is_replying correctly reports when the language model is still generating a response.
  • Confirmed that reply pieces were streamed using conversation_get_reply_piece until the reply was complete.
  • Verified consistent behaviour across all four language implementations.
  • No runtime errors occurred during testing.

Testing Checklist

  • Tested in latest Chrome
  • Tested in latest Firefox
  • npm run build
  • npm run preview

Checklist

If involving code

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings

If modified config files

  • I have checked the following files for changes:
    • package.json
    • astro.config.mjs
    • netlify.toml
    • docker-compose.yml
    • custom.css

Folders and Files Added/Modified

Added

  • public/usage-examples/generative_ai/conversation_is_replying-1-example.cpp
  • public/usage-examples/generative_ai/conversation_is_replying-1-example-top-level.cs
  • public/usage-examples/generative_ai/conversation_is_replying-1-example-oop.cs
  • public/usage-examples/generative_ai/conversation_is_replying-1-example.py
  • public/usage-examples/generative_ai/conversation_is_replying-1-example.txt
  • public/usage-examples/generative_ai/conversation_is_replying-1-example.gif

Additional Notes

This example uses SplashKit's default language model and focuses on demonstrating how conversation_is_replying can be used to monitor reply generation while streaming the response in real time using conversation_get_reply_piece. The animated GIF has been included to better illustrate the streaming behaviour compared to a static image.

@netlify

netlify Bot commented Aug 4, 2026

Copy link
Copy Markdown

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit d66c8db
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/6a8050b606de6700087c89e8

@AAMIRAU AAMIRAU left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed the changes. The conversation_is_replying example is clear and consistent across all supported language versions. The streaming behaviour is demonstrated well and the implementation looks good to me.

@ralphweng2023 ralphweng2023 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The conversation_is_replying example demonstrates the function well in Python and C++, but the C# top-level and C# OOP files call the conversation methods as static functions with chat as the first argument.

api.json declares them as instance methods on the Conversation class: Conversation.AddMessage(string) is instance with no chat arg, and IsReplying, GetReplyPiece, and Free are instance methods too.

So ConversationAddMessage(chat, question) will not compile, since there is no SplashKit.ConversationAddMessage static. The same applies to ConversationIsReplying, ConversationGetReplyPiece, and FreeConversation.

Please switch the C# files to chat.AddMessage(question), chat.IsReplying(), chat.GetReplyPiece(), and chat.Free(). Once that's updated I'll be happy to take another look.

Comment thread public/usage-examples/generative_ai/conversation_is_replying-1-example-oop.cs Outdated
Comment thread public/usage-examples/generative_ai/conversation_is_replying-1-example-oop.cs Outdated
Comment thread public/usage-examples/generative_ai/conversation_is_replying-1-example-oop.cs Outdated
Comment thread public/usage-examples/generative_ai/conversation_is_replying-1-example-oop.cs Outdated
@jasveena15

Copy link
Copy Markdown
Author

The conversation_is_replying example demonstrates the function well in Python and C++, but the C# top-level and C# OOP files call the conversation methods as static functions with chat as the first argument.

api.json declares them as instance methods on the Conversation class: Conversation.AddMessage(string) is instance with no chat arg, and IsReplying, GetReplyPiece, and Free are instance methods too.

So ConversationAddMessage(chat, question) will not compile, since there is no SplashKit.ConversationAddMessage static. The same applies to ConversationIsReplying, ConversationGetReplyPiece, and FreeConversation.

Please switch the C# files to chat.AddMessage(question), chat.IsReplying(), chat.GetReplyPiece(), and chat.Free(). Once that's updated I'll be happy to take another look.

fixed the code , pls check again

@ekam313 ekam313 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peer Review

I've reviewed the conversation_is_replying usage example and tested all four language implementations. The example clearly demonstrates how conversation_is_replying can be used to monitor an AI response while retrieving reply pieces as they are generated.

Checks

  • All required files are present.
  • Example Title (.txt)
  • C++ code
  • C# code (top-level statements)
  • C# code (Object-Oriented Programming)
  • Python code
  • Code correctly uses SplashKit functions.
  • Code clearly demonstrates the conversation_is_replying function.
  • All versions maintain the same structure and behaviour.

Code Tests done

  • C++ code ran correctly.
  • C# top-level code ran correctly.
  • C# OOP code ran correctly.
  • Python code ran correctly.

Website Tests done

  • npm run build
  • npm run preview

The example works as expected and is ready to proceed to the next review stage.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants