Skip to content

Add free_conversation usage example for generative_ai category#757

Open
himanshigaba22 wants to merge 4 commits into
thoth-tech:mainfrom
himanshigaba22:free-conversation-usage-example
Open

Add free_conversation usage example for generative_ai category#757
himanshigaba22 wants to merge 4 commits into
thoth-tech:mainfrom
himanshigaba22:free-conversation-usage-example

Conversation

@himanshigaba22
Copy link
Copy Markdown

Description

Added a usage example for the free_conversation and free_all_conversations functions in the generative_ai category.

The example demonstrates proper lifecycle management of AI conversation resources by:

  • Creating multiple conversation instances using create_conversation()
  • Freeing individual conversations using free_conversation()
  • Freeing all remaining conversations using free_all_conversations()

Type of change

  • Documentation (update or new)

How Has This Been Tested?

The example output was verified manually to ensure conversations are correctly created and released.

Testing Checklist

  • Code follows usage example guidelines
  • Output is correct and clear
  • Screenshot added

@netlify
Copy link
Copy Markdown

netlify Bot commented May 5, 2026

Deploy Preview for splashkit failed.

Name Link
🔨 Latest commit 5e91aa3
🔍 Latest deploy log https://app.netlify.com/projects/splashkit/deploys/6a05804153e446000820c2c6

@himanshigaba22 himanshigaba22 force-pushed the free-conversation-usage-example branch from 7bec872 to cb9f425 Compare May 5, 2026 08:10
Copy link
Copy Markdown

@Osaid2993 Osaid2993 left a comment

Choose a reason for hiding this comment

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

This PR should be split. It currently combines two usage examples in one submission, which makes tracking harder and increases overlap. Please keep one usage example per PR and make sure there is a proper card for each one.

@himanshigaba22
Copy link
Copy Markdown
Author

himanshigaba22 commented May 5, 2026 via email

@Osaid2993
Copy link
Copy Markdown

I checked the files changed. The issue is not the 6 files. The issue is that the same usage example mixes two different functions, it starts with freeing individual conversations and then also shows freeing all remaining conversations, which is why I said it should be split.

@himanshigaba22 himanshigaba22 force-pushed the free-conversation-usage-example branch 2 times, most recently from 7bec872 to d56370b Compare May 6, 2026 06:48
@himanshigaba22 himanshigaba22 force-pushed the free-conversation-usage-example branch from 6c1ae96 to d5b3d40 Compare May 6, 2026 06:52
@himanshigaba22
Copy link
Copy Markdown
Author

himanshigaba22 commented May 6, 2026 via email

@anandika-nair
Copy link
Copy Markdown

The updated usage example is now much clearer and stays focused on demonstrating a single function, which makes it easier for beginners to understand. The implementation across C++, C#, and Python also appears consistent and follows the usage example structure well. The comments are simple and explain the purpose of the code clearly without overcomplicating the example. Overall, this looks like a clean and beginner-friendly contribution to the generative_ai category. The remaining failing checks may just need to be resolved before the PR can be merged.

Copy link
Copy Markdown

@Osaid2993 Osaid2993 left a comment

Choose a reason for hiding this comment

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

Hi @himanshigaba22 Thanks for the update. the code looks much better now and it is focused on free_conversation. However, the screenshot still shows the old output from the previous version. Please update the .png to match the current example output, then I’m happy approve it.

Copy link
Copy Markdown

@222448082Ashen 222448082Ashen left a comment

Choose a reason for hiding this comment

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

Description

This PR adds a new usage example for the FreeConversation function within the generative_ai category. It provides consistent demonstrations across C++, C# (Top-level and OOP), and Python to show how to release AI conversation resources.

Type of change

  • Documentation (update or new)

How Has This Been Tested?

The code examples were manually reviewed for syntax correctness and structural consistency across all supported languages. The file structure was verified against repository standards.

  • Verified file structure in public/usage-examples/generative_ai/
  • Checked cross-language structural consistency
  • npm run build (Failed in current environment due to unrelated script dependencies)
  • 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

N/A (No config files modified)

Folders and Files Added/Modified

  • Added:
    • public/usage-examples/generative_ai/free_conversation-1-example.cpp
    • public/usage-examples/generative_ai/free_conversation-1-example-oop.cs
    • public/usage-examples/generative_ai/free_conversation-1-example-top-level.cs
    • public/usage-examples/generative_ai/free_conversation-1-example.py
    • public/usage-examples/generative_ai/free_conversation-1-example.txt
    • public/usage-examples/generative_ai/free_conversation-1-example.png

Additional Notes

The example is correctly isolated within the generative_ai folder. Note that the Python implementation uses snake_case (free_conversation) which is consistent with the library's convention for that language.

@himanshigaba22
Copy link
Copy Markdown
Author

I checked the files changed. The issue is not the 6 files. The issue is that the same usage example mixes two different functions, it starts with freeing individual conversations and then also shows freeing all remaining conversations, which is why I said it should be split.

Thanks for the feedback, I have now updated the screenshot to match the current output of the simplified free_conversation example and pushed the changes. Please have another look when you get a chance. Thank you!

@himanshigaba22
Copy link
Copy Markdown
Author

This PR should be split. It currently combines two usage examples in one submission, which makes tracking harder and increases overlap. Please keep one usage example per PR and make sure there is a proper card for each one.

Hi! Thank you for the feedback. I have already split the example —
this PR now only demonstrates free_conversation() with a single
conversation instance. The free_all_conversations() function has
been completely removed from this PR.

The Files changed tab now shows only 6 files focused on
free_conversation only. Please let me know if anything else
needs changing. Thank you!

Copy link
Copy Markdown
Author

@himanshigaba22 himanshigaba22 left a comment

Choose a reason for hiding this comment

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

Hi! I have addressed both issues:

  • Added using SplashKitSDK; to the top-level C# file
  • Added the free_conversation entry to usage-example-references.json
    under a new generative_ai section

Please let me know if anything else needs changing. Thank you!

Copy link
Copy Markdown

@Osaid2993 Osaid2993 left a comment

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 free_conversation usage example PR.

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 function.

  • All versions maintain the same structure and comments.

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 updated screenshot now matches the current example output, and the PR is focused on free_conversation. Nice work.

@anandika-nair
Copy link
Copy Markdown

The PR looks good. All comments are been approved, I am happy to approve. Thank you.

Copy link
Copy Markdown

@222448082Ashen 222448082Ashen left a comment

Choose a reason for hiding this comment

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

All comments are been approved, I am happy to approve.

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.

6 participants