Class for summarizing a dataset of PDFs. Models such as gpt via API, … - #12
Open
johnma96 wants to merge 4 commits into
Open
Class for summarizing a dataset of PDFs. Models such as gpt via API, …#12johnma96 wants to merge 4 commits into
johnma96 wants to merge 4 commits into
Conversation
…llama3.2 via API using the ollama library, or the openai library are permitted. The structure uses Python generators to develop the summaries so that they can be API-ed and avoid RAM collapse.
Compara la misma tool (get_ticket_price) capa contra capa: - OpenAI Responses API: el diccionario se aplana, sin envoltura "function" - Claude: decorador @beta_tool + tool_runner, con input_schema - Gemini: se pasa la función de Python directamente, sin diccionario ni bucle - LangChain/LangGraph: @tool + create_agent, y bind_tools sin grafo - openai-agents: @function_tool + Runner Incluye dos aclaraciones que suelen confundir: la comparación no es pareja porque enfrenta API cruda contra SDK de agentes, y en LangGraph la herramienta no es un nodo del grafo sino una función que ejecuta ToolNode. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Amplía day5 con entrada de voz, precios reales y reserva simulada: - escuchar(): agente nuevo de voz a texto con Whisper - buscar_vuelos(): tarifas reales en COP mediante scraping - reservar_vuelo() / consultar_reserva(): mockup persistido en .json - artist() y talker(): reusados de day5 - Interfaz Gradio con micrófono, imagen del destino y respuesta hablada Decisiones que conviene recordar: - Sin ffmpeg: talker() devuelve la ruta del mp3 y lo reproduce el navegador, y Whisper acepta el webm del micrófono sin conversión. Queda documentada la alternativa imageio-ffmpeg, que trae un binario estático vía pip. - avianca.com responde 403 (Akamai) y sus términos prohíben la extracción automatizada, así que las tarifas se consultan por Google Flights, que sí publica precios reales de Avianca. - El parámetro tfs (protobuf + base64) se serializa a mano para no subir protobuf a >=6, lo que rompería google-generativeai usado en day4. - Gradio 6: gr.Chatbot ya no acepta type="messages" y el historial llega con campos extra y contenido troceado que la API de OpenAI rechaza; se añade normalizar_historial() y un shim compatible con Gradio 4, 5 y 6. - La herramienta de reserva no expone campos para documento, medio de pago ni contacto: minimización en el propio contrato de la herramienta. Limpia además las salidas de day5.ipynb e ignora week2/reservas/. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Clase para resumir un dataset de pdfs. Se permiten modelos como gpt via api, llama3.2 via api empleando librería ollama o librería de openai. La estructura emplea generadores de python para desarrollar los resúmenes de manera que se pueda apificar y evitar el colapso en memoria RAM.