Skip to content

Add skill for deck of cards API#538

Closed
Deeptanshu-sankhwar wants to merge 6 commits intocrestalnetwork:mainfrom
Deeptanshu-sankhwar:skill/deck-of-cards
Closed

Add skill for deck of cards API#538
Deeptanshu-sankhwar wants to merge 6 commits intocrestalnetwork:mainfrom
Deeptanshu-sankhwar:skill/deck-of-cards

Conversation

@Deeptanshu-sankhwar
Copy link
Contributor

Description

Added the skill for deck of cards API with the following features

shuffle_deck() — Initialize and shuffle a full deck.

draw_cards(deck_id, count) — Draw X number of cards.

add_to_pile(deck_id, pile_name, cards) — Add cards to a named pile.

draw_from_pile(deck_id, pile_name) — Draw cards from a named pile.

list_piles(deck_id) — View existing piles and contents.

Type of Change

  • Bugfix
  • New Feature
  • Improvement
  • Documentation Update

Checklist

  • I have read the contributing guidelines.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Related Issue

Closes #526

@hyacinthus
Copy link
Collaborator

Thank you for the interesting idea.

I understand you want to load all the skills holistically, but due to some non-core limitations, we currently must list all skills in the config. Here are two methods to consider:

  1. List all skills normally. In the overall description of the schema, tell the user to select all skills.
  2. Encapsulate all APIs into a skill, using an Action as a parameter, allowing the AI to pass in the action to call different operations.

The second option seems slightly better.



class SkillStates(TypedDict):
shuffle_deck: SkillState
Copy link
Collaborator

Choose a reason for hiding this comment

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

Or maybe you just missing others here?

name = "draw_cards"
description = "Draw a specified number of cards from a deck"

async def _arun(self, deck_id: str, count: int = 1) -> str:
Copy link
Collaborator

Choose a reason for hiding this comment

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

If there are parameters, you need to declare them in args_schema; otherwise, the AI will not call it. It seems there are still many problems; please complete it and pass the local test.

@bluntbrain
Copy link
Contributor

Closing this PR since it's been inactive for a while and improvements have been made elsewhere. Happy to reopen it later if needed. thanks!

@bluntbrain bluntbrain closed this May 26, 2025
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.

Feature Wishlist: Integrate Deck of Cards API

3 participants