Update app.py
Browse files
app.py
CHANGED
|
@@ -166,7 +166,7 @@ def reverse_text(text: str) -> str:
|
|
| 166 |
return text[::-1]
|
| 167 |
|
| 168 |
@tool
|
| 169 |
-
def find_non_commutative(table: dict) -> str:
|
| 170 |
"""
|
| 171 |
Given a dictionary representing a multiplication table (keys are tuples (row_elem, col_elem)),
|
| 172 |
finds all elements involved in non-commutative pairs (where table[(x,y)] != table[(y,x)]).
|
|
@@ -445,7 +445,7 @@ SYSTEM_MESSAGE = """You are a concise AI assistant with access to the following
|
|
| 445 |
- wiki_get_page(title: string) β string
|
| 446 |
- youtube_transcript(video_id: string) β string
|
| 447 |
- reverse_text(text: string) β string
|
| 448 |
-
- find_non_commutative(table: dict) ->
|
| 449 |
- libretext_extract(url: string, selector: string) β string
|
| 450 |
- classify_vegetables(items: list[string]) β list[string]
|
| 451 |
- execute_code(code: string) β string
|
|
|
|
| 166 |
return text[::-1]
|
| 167 |
|
| 168 |
@tool
|
| 169 |
+
def find_non_commutative(table: dict[tuple[str, str]: str]) -> str:
|
| 170 |
"""
|
| 171 |
Given a dictionary representing a multiplication table (keys are tuples (row_elem, col_elem)),
|
| 172 |
finds all elements involved in non-commutative pairs (where table[(x,y)] != table[(y,x)]).
|
|
|
|
| 445 |
- wiki_get_page(title: string) β string
|
| 446 |
- youtube_transcript(video_id: string) β string
|
| 447 |
- reverse_text(text: string) β string
|
| 448 |
+
- find_non_commutative(table: dict[tuple[str, str]: str]) -> str : Returns sorted list of non-commutative elements or a list containing an error message. Example table format: {('a','a'):'a', ('a','b'):'c', ('b','a'):'d', ...}
|
| 449 |
- libretext_extract(url: string, selector: string) β string
|
| 450 |
- classify_vegetables(items: list[string]) β list[string]
|
| 451 |
- execute_code(code: string) β string
|