Conversation
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.
Integración del proveedor OpenAI
Este PR introduce soporte para el proveedor OpenAI dentro de ModelRouter. Se han añadido
los siguientes elementos:
Adapter
OpenAIAdapterProviderAdapter.stream()ygenerate()que adaptan la interfaz comúna las APIs de OpenAI.
model,max_tokens,temperaturey streaming.tokens_prompt,tokens_completion,tokens_total).Tests unitarios
tests/test_providers_openai_adapter.pycubre streaming y generación.pytest) pasa sin errores.tests/test_adapters.py) y de routerfuncionan con el nuevo proveedor.
Configuración y documentación
api/config.pyañade variablesopenai_api_key,openai_base_url,openai_default_model,openai_rate_limit..env.exampleactualizada con las claves/urls de OpenAI.README.mdyROADMAP.mdincluyen las menciones correspondientes.docs/configuration.mdincluye variables para OpenAI.api/main.pyregistra y configura el adapter cuando se proporciona la clave.Cierre en roadmap
ROADMAP.md.Notas
el mantenimiento y la extensión.
functions), se pueden extender los métodos_build_payloady el parsing derespuesta sin afectar al resto de la aplicación.