You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
# Quick CLI script to analyze a dataset of question-answer pairs.
1
+
"""Dataset analysis module for Cairo Coder.
2
+
3
+
This module provides tools for analyzing question-answer datasets using LLMs.
4
+
"""
2
5
3
6
importjson
7
+
frompathlibimportPath
8
+
fromtypingimportAny
4
9
5
10
importdspy
6
11
fromdspy.adapters.baml_adapterimportBAMLAdapter
7
12
8
13
9
14
classDatasetAnalyzer(dspy.Signature):
10
-
"""
11
-
You are provided a dataset of question-answer pairs.
12
-
This dataset is related to the Starknet blockchain and the Cairo programming language, and contains
13
-
mostly technical questions about code, infrastructure, and the overall Starknet ecosystem.
14
-
Your task is to analyze the dataset and provide valuable insights.
15
+
"""Analyze a dataset of question-answer pairs.
16
+
17
+
This signature is designed for analyzing datasets related to the Starknet
18
+
blockchain and Cairo programming language, containing mostly technical
19
+
questions about code, infrastructure, and the Starknet ecosystem.
15
20
"""
16
21
17
-
dataset: list[dict] =dspy.InputField(
18
-
desc="The dataset of question-answer pairs."
19
-
)
22
+
dataset: list[dict] =dspy.InputField(desc="The dataset of question-answer pairs.")
20
23
languages: list[str] =dspy.OutputField(
21
24
desc="The list of all languages users have asked queries with."
22
25
)
@@ -30,7 +33,7 @@ class DatasetAnalyzer(dspy.Signature):
30
33
- "When im importing stuff from a file in my smart contract, what is the difference between super:: and crate:: ?" -> "Cairo language questions"
31
34
- "how to use the `assert!` macro in my smart contract" -> "Cairo language questions"
32
35
- "I am writing a function in my smart contract. I need to be sure the caller has enough balance or it reverts. how do I do this?" -> "Starknet smart contracts questions"
33
-
- "what does this error mean :\n```\n Account validation failed: \"StarknetError { code: KnownErrorCode(ValidateFailure), message: 'The 'validate' entry point panicked with: nError in contract (contract address: 0x0762c126b2655bc371c1075e2914edd42ba40fc2c485b5e8772f05c7e09fec26, class hash: 0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f, selector: 0x0289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3): n0x617267656e742f696e76616c69642d7369676e61747572652d6c656e677468 ('argent invalid signature length'). n' }```" -> "Debugging errors questions"
36
+
- "what does this error mean :\\n```\\n Account validation failed: \\"StarknetError { code: KnownErrorCode(ValidateFailure), message: 'The 'validate' entry point panicked with: nError in contract (contract address: 0x0762c126b2655bc371c1075e2914edd42ba40fc2c485b5e8772f05c7e09fec26, class hash: 0x036078334509b514626504edc9fb252328d1a240e4e948bef8d0c08dff45927f, selector: 0x0289da278a8dc833409cabfdad1581e8e7d40e42dcaed693fa4008dcdb4963b3): n0x617267656e742f696e76616c69642d7369676e61747572652d6c656e677468 ('argent invalid signature length'). n' }\\"```" -> "Debugging errors questions"
34
37
- "How to declare and deploy a contract with constructor to sepolia or mainnet using starkli?" -> "Starknet network interactions questions"
35
38
"""
36
39
)
@@ -44,23 +47,50 @@ class DatasetAnalyzer(dspy.Signature):
0 commit comments