0
0
Agentic_aiml~10 mins

Code generation agent design in Agentic Ai - Interactive Code Practice

Choose your learning style8 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to initialize the agent's model with a transformer architecture.

Agentic_ai
agent_model = TransformerModel([1]=512, num_layers=6)
Drag options to blanks, or click blank then click option'
Alearning_rate
Bdropout_rate
Cbatch_size
Dhidden_size
Attempts:
3 left
2fill in blank
medium

Complete the code to tokenize input text before feeding it to the agent.

Agentic_ai
tokens = tokenizer.[1](input_text)
Drag options to blanks, or click blank then click option'
Aencode
Bdecode
Cgenerate
Dtrain
Attempts:
3 left
3fill in blank
hard

Fix the error in the code to correctly generate code output from the agent.

Agentic_ai
generated_code = agent.[1](input_tokens)
Drag options to blanks, or click blank then click option'
Atrain
Bgenerate_code
Cpredict
Dcompile
Attempts:
3 left
4fill in blank
hard

Fill both blanks to create a dictionary comprehension that maps function names to their code strings if the code length is less than 50.

Agentic_ai
code_map = {func_name: [1] for func_name, [2] in functions.items() if len(code) < 50}
Drag options to blanks, or click blank then click option'
Acode
Bfunc_code
Ccode_str
Attempts:
3 left
5fill in blank
hard

Fill all three blanks to filter and map functions with names starting with 'gen' and code length over 30.

Agentic_ai
filtered_funcs = { [1]: [2] for [3], code in all_functions.items() if [3].startswith('gen') and len(code) > 30 }
Drag options to blanks, or click blank then click option'
Aname
Bfunc_name
Ccode
Dfunc_code
Attempts:
3 left