






Prepara tus exámenes y mejora tus resultados gracias a la gran cantidad de recursos disponibles en Docsity
Gana puntos ayudando a otros estudiantes o consíguelos activando un Plan Premium
Esta página no es visible en la vista previa
¡No te pierdas las partes importantes!







35 preguntas de práctica. La respuesta correcta está marcada en verde.
A. Truncate the policy text to its first paragraph B. Order the static system prompt and policy first, the variable user content last, and enable prompt caching C. Move the policy text into the user turn D. Split every request across two smaller calls Rationale: A stable prefix plus caching lets repeated content be reused, cutting both time-to-first-token and per-request cost without losing context. Truncation (A) discards required policy, relocating text (C) changes nothing about reuse, and splitting calls (D) adds overhead.
A. Parallel synchronous Messages API calls at maximum concurrency B. Synchronous calls with reduced max_tokens C. The Message Batches API, submitting all tickets and collecting results within the processing window D. One giant request containing all 40,000 tickets Rationale: Latency-tolerant bulk work is exactly what the Batches API is for: 50% of the cost, results within a 24-hour window, correlated by custom_id. Parallel synchronous calls (A) pay full price for speed nobody needs, max_tokens (B) does not change per-token pricing, and a single request (D) exceeds any context window.
A. Add "always return valid JSON" in capital letters to the prompt B. Wrap the parse in a try block and silently skip failures C. Lower the temperature to zero D. Enforce the shape through tool use with a JSON schema, validate the result, and on validation failure retry with the error fed back Rationale: Schema-enforced output plus a validation-retry loop treats model output as untrusted input and gives the model the information to correct itself. Louder instructions (A) reduce but do not eliminate failures, silent skipping (B) hides data loss, and temperature (C) does not guarantee syntax.
A. A workflow that calls the model for extraction inside deterministic orchestration, because the path is known in advance and determinism is cheaper and more reliable B. The agent, because agents are more capable than fixed code C. The agent, because it can skip steps when it decides they are unnecessary D. Two agents supervising each other Rationale: When the sequence is fixed, orchestrate it in code and use the model where the model adds value. Autonomy buys nothing on a known path and adds nondeterminism (B), skipping validation is a defect rather than a feature (C), and supervision hierarchies (D) are for problems that need delegation, not four fixed steps.
A. Treat the turn as finished and show the partial text to the user B. Execute the requested tool, append the tool result to the conversation, and call the API again C. Retry the same request until stop_reason becomes "end_turn" D. Increase max_tokens and resend Rationale: That is the agentic loop: "tool_use" means the model is waiting for a tool result before it can continue. Ending the turn (A) abandons the model mid-task, re-rolling (C) re-asks the same question while ignoring the request, and max_tokens (D) is unrelated to tool dispatch.
A. Prompt the model to behave like the previous version B. Retry failed requests against a different provider C. Pin the model version in production and treat upgrades as evaluated, deliberate changes D. Catch the errors and return empty responses Rationale: Version pinning makes model behavior a controlled dependency; upgrades then pass through evaluation like any other change. Prompting for old behavior (A) is not a contract, failover (B) trades one behavior change for another, and empty responses (D) institutionalize the failure.
A. The model, so switch to a larger one B. The prompt, so add stronger wording about accuracy C. The retrieval layer, so fix the search or indexing that selects documents D. The users, so publish usage guidance Rationale: The traces localize the fault: the model is correct given its inputs, and the inputs are wrong. That is an integration-layer defect. Model upgrades (A) and prompt exhortations (B) cannot fix inputs, and blaming users (D) ignores the evidence.
A. Shorten the instructions until the cost is acceptable B. Move to a smaller model C. Batch requests together and process them hourly D. Cache the stable prefix so the repeated block is not reprocessed on every call Rationale: A large, unchanging prefix is exactly what prompt caching exists for, and it cuts both cost and time to first token without changing behavior. Trimming instructions (A) sacrifices capability, a smaller model (B) trades quality for price, and batching (C) breaks a per-request service.
A. Streaming the response so tokens are delivered as they are generated B. A smaller model so the whole response arrives sooner C. Splitting the prompt into several shorter calls D. Reducing the maximum output tokens Rationale: Streaming is the mechanism for incremental delivery and is what perceived latency depends on. A smaller model (B) and a shorter cap (D) reduce total time without changing when the first token appears, and splitting (C) adds round trips.
A. Streaming requests one at a time to show progress B. Submitting the work as a batch, accepting higher latency for lower cost C. Running them in parallel at maximum concurrency against the standard endpoint D. Splitting the job across several API keys Rationale: Work that is large, uniform, and not time-critical is what batch processing is for, and it is materially cheaper. Streaming (A) serves interactive use, maximum concurrency (C) risks rate limits for no benefit here, and splitting keys (D) is an evasion rather than a design.
A. Retry immediately until the call succeeds B. Treat the response as a permanent failure and surface an error C. Retry with exponential backoff and a bounded number of attempts D. Lower the request size so the limit is never reached Rationale: Backoff with a retry ceiling relieves the pressure that caused the limit and still fails predictably. Immediate retries (A) worsen the condition, treating it as terminal (B) discards recoverable work, and shrinking requests (D) does not address a rate that is measured in calls.
A. Ask for JSON in the prompt and parse whatever comes back B. Ask for JSON and retry when parsing fails C. Post-process the prose into fields with regular expressions D. Define the shape as a tool schema so the response is returned in a validated structure Rationale: A declared schema turns structure into a contract the response must satisfy, which is what a typed insert needs. Asking in prose (A) and retrying on failure (B) both leave the shape to chance, and regular expressions over prose (C) are brittle by construction.
A. Summarise earlier turns into a compact running state and carry that forward B. Truncate the oldest turns and continue C. Increase the maximum output tokens D. Start a new conversation with no history Rationale: Compaction preserves the meaning of earlier exchanges within a much smaller footprint, which is what continuity requires. Blind truncation (B) drops facts silently, the output cap (C) is unrelated, and starting fresh (D) discards the state entirely.
A. The model's published price B. Token usage per request, including how much context is resent each call C. The number of API keys in use D. The average response time Rationale: With volume flat, cost per request must have grown, and context sent per call is the usual driver. Published price (A) would be a known change, key count (C) does not affect cost, and latency (D) is not billed.
A. Choose the one with the better published benchmark scores B. Choose the newer model, since it supersedes the older one C. Measure both against a representative sample of the real task and its quality bar D. Choose the larger model and reduce cost elsewhere Rationale: Model choice is empirical and task-specific, which is what a representative evaluation establishes. Benchmarks (A) may not reflect the task, recency (B) is not a measurement, and defaulting to size (D) decides before evidence.
A. An agent that decides the order at runtime B. A multi-agent system with one agent per step C. A single prompt containing all the steps D. A deterministic workflow that calls the model at defined points Rationale: When the path is known in advance, encoding it directly is cheaper, faster, and far easier to debug than letting a model rediscover it each run. Runtime decisions (A, B) add nondeterminism with no benefit, and a single prompt (C) removes the checkpoints between steps.
A. The steps required cannot be known until intermediate results are seen B. The task is long C. The task involves several different tools D. The output must be structured Rationale: Agents earn their cost where the path must be discovered during execution. Length (B), tool count (C), and structured output (D) are all satisfied by a fixed workflow.
A. The subagent needs a larger model B. The subagent lacks context the main agent held, and the handoff did not carry it C. Subagents are unsuitable for pipelines D. The pipeline needs more subagents Rationale: Delegation trades context for isolation, and quality falls when the handoff omits what the subtask needed. A larger model (A) cannot supply missing context, subagents are widely used in pipelines (C), and adding more (D) multiplies the same fault.
A. To reduce the cost of a successful run B. To make the agent respond faster C. To bound the damage and expense when the agent fails to converge D. To simplify the prompt Rationale: A step ceiling is a safety bound for the non-terminating case, which is the failure mode that matters. Successful runs (A) usually finish well inside the limit, and neither speed (B) nor prompt clarity (D) is what the limit governs.
A. Adding emphasis to the most important constraint B. Repeating the constraints at the end of the prompt C. Raising the temperature so the model explores more options D. Giving the model an example of a compliant output Rationale: A worked example makes the constraints concrete and demonstrates their interaction, which prose cannot. Emphasis (A) and repetition (B) restate without clarifying, and higher temperature (C) increases variance, which is the opposite of reliability.
A. In the system prompt, so they apply consistently across the exchange B. In the first user message of every conversation C. In the final message, so they are freshest D. Repeated in every user message Rationale: The system prompt is the designated place for persistent framing and keeps it separate from turn-specific content. Placing it in user turns (B, C, D) mixes configuration with input and invites drift.
A. Add a prompt instruction telling the model to ignore embedded instructions B. Treat all fetched content as data, and enforce permissions outside the model C. Filter for the phrase before processing D. Use a larger model, which is less susceptible Rationale: Retrieved content is untrusted input, and the durable defense is that the model's authority is limited by the surrounding system rather than by its own compliance. Prompt instructions (A), phrase filters (C), and model size (D) are all bypassable.
A. Provide full credentials so the model can handle any request B. Provide read and write access but instruct the model to avoid writes C. Expose only the specific operations the task requires, scoped to what it may touch D. Provide access through a tool with no schema so it stays flexible Rationale: Least privilege bounds the consequences of any mistake or manipulation, and it is enforced outside the prompt. Full credentials (A) and instruction-based restraint (B) rely on behavior rather than control, and an unscoped tool (D) removes the boundary.
A. Ship it, since three examples agreed B. Ask the model whether the new prompt is better C. Ship it behind a flag and watch for complaints D. Run it against a held-out set that represents the real distribution and compare on defined criteria Rationale: Three hand-picked examples cannot distinguish a real improvement from noise, which is what an evaluation set exists to settle. Self-assessment (B) is not measurement, and shipping first (A, C) makes users the test set.