Cuestionario vinculado a una guía · Medio Nivel
Cómo crear un chatbot con un cuestionario API de LLM
Cree un chatbot en torno a un bucle de solicitud de API, diferencias de estado y proveedor, transmisión, ejecución de herramientas, límites de tokens y manejo seguro de errores.
Pregunta 1 de 8
En un flujo de finalización de chat administrado por el cliente, ¿qué contexto se envía comúnmente en cada nuevo turno?
Vista previa de cada pregunta8 preguntas
Las respuestas y explicaciones aparecen a medida que realiza el cuestionario.
- En un flujo de finalización de chat administrado por el cliente, ¿qué contexto se envía comúnmente en cada nuevo turno?
- Only the newest user message
- The full array of prior messages plus the new one
- A compressed binary session token
- Just the system prompt
- En un flujo de chat sin estado y administrado por el cliente, ¿por qué el bot puede hacer referencia a turnos anteriores?
- The model stores a session on the provider's server automatically
- The client resends the full message history on every call
- The API caches embeddings of prior turns
- The model has a persistent memory across all users
- Según la guía, ¿cuál es el principal beneficio práctico de transmitir respuestas en un chatbot?
- It reduces the total token cost of the request
- It allows the model to skip the system prompt
- It improves perceived speed by rendering text as it arrives
- It removes the need for error handling
- Según la guía, ¿qué debería desencadenar un retroceso exponencial en lugar de un reintento inmediato?
- A successful 200 response
- Rate limit errors (429) and transient server errors (5xx)
- Any assistant message longer than expected
- A user typing a new message
- ¿Cómo se incorporan las llamadas de herramientas al ciclo básico del chatbot?
- The model executes the function itself on the provider's servers
- The application runs the requested function and appends its result as a message before calling the model again
- Tool calls replace the system prompt entirely
- The client must switch to a different API endpoint
- For a new OpenAI chatbot, what API and conversation-state approach does current documentation recommend?
- Chat Completions is no longer supported
- Responses is recommended for new projects; Chat Completions remains supported and commonly uses client-supplied message history
- Responses can only accept one user turn
- Both APIs always store the same server-side conversation
- Why is counting characters or words insufficient for managing a chatbot's context window?
- Context limits are enforced in tokens, which don't map directly to characters or words
- Characters are always more expensive than tokens
- The API rejects any request with punctuation
- Word counts are only relevant for streaming
- According to the guide, what is a recommended strategy when a conversation's message array grows too large for the context window?
- Delete the system prompt to save space
- Trim or summarize older turns before the limit is reached
- Switch every message to the assistant role
- Stop streaming responses