-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ChatGPT wrapper pipeline #195
Conversation
…sometimes otherwise
WalkthroughThis pull request encompasses several modifications across different components of the application. The changes include updating the README documentation with standardized configuration file naming, modifying type declarations in data transfer objects, enhancing OpenAPI schema security, introducing a new ChatGPT wrapper pipeline, and improving error logging with Sentry integration. The modifications aim to improve code structure, documentation clarity, and error tracking capabilities. Changes
Sequence DiagramsequenceDiagram
participant Client
participant FastAPI
participant ChatGPTWrapperPipeline
participant LLM
Client->>FastAPI: Send chat request
FastAPI->>ChatGPTWrapperPipeline: Initialize pipeline
ChatGPTWrapperPipeline->>LLM: Generate response
LLM-->>ChatGPTWrapperPipeline: Return response
ChatGPTWrapperPipeline-->>FastAPI: Process complete
FastAPI-->>Client: Return response
Possibly related PRs
Suggested labels
✨ Finishing Touches
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Followup to #185 and #194 as I was not able to make push any more changes to the existing branch due to rule: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actionable comments posted: 1
🧹 Nitpick comments (3)
app/pipeline/chat_gpt_wrapper_pipeline.py (1)
63-63
: Remove unused attributeself.tokens
The attribute
self.tokens
is initialized but not used elsewhere in the class. Removing it can clean up the code.Apply this diff to remove the unused attribute:
- self.tokens = []
app/web/routers/pipelines.py (2)
78-83
: Consider using pattern matching for variant handling.The if-else structure for variant handling deviates from the pattern used in other pipeline implementations (e.g., text_exercise_chat_pipeline_worker) which use pattern matching. Consider using a match statement for consistency.
- if variant == "chat-gpt-wrapper": - thread = Thread(target=run_chatgpt_wrapper_pipeline_worker, args=(dto, variant)) - else: - thread = Thread( - target=run_exercise_chat_pipeline_worker, args=(dto, variant, event) - ) + match variant: + case "chat-gpt-wrapper": + thread = Thread(target=run_chatgpt_wrapper_pipeline_worker, args=(dto, variant)) + case _: + thread = Thread( + target=run_exercise_chat_pipeline_worker, args=(dto, variant, event) + )
325-332
: Consider adding more descriptive feature information.The feature DTO for CHAT_GPT_WRAPPER provides minimal information. Consider enhancing the description to indicate its experimental nature and any limitations or specific use cases.
case "CHAT_GPT_WRAPPER": return [ FeatureDTO( id="default", name="Default Variant", - description="Default ChatGPT wrapper variant.", + description="Experimental ChatGPT wrapper variant for direct model interaction. Note: This is a temporary implementation for testing purposes.", ) ]
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
⛔ Files ignored due to path filters (2)
application.example.yml
is excluded by!**/*.yml
example_application.yml
is excluded by!**/*.yml
📒 Files selected for processing (10)
README.MD
(6 hunks)app/domain/status/text_exercise_chat_status_update_dto.py
(1 hunks)app/main.py
(1 hunks)app/pipeline/chat/course_chat_pipeline.py
(1 hunks)app/pipeline/chat/exercise_chat_agent_pipeline.py
(1 hunks)app/pipeline/chat_gpt_wrapper_pipeline.py
(1 hunks)app/pipeline/prompts/chat_gpt_wrapper_prompts.py
(1 hunks)app/pipeline/shared/citation_pipeline.py
(1 hunks)app/web/routers/pipelines.py
(4 hunks)app/web/status/status_update.py
(1 hunks)
✅ Files skipped from review due to trivial changes (4)
- app/pipeline/prompts/chat_gpt_wrapper_prompts.py
- app/pipeline/shared/citation_pipeline.py
- app/pipeline/chat/course_chat_pipeline.py
- app/pipeline/chat/exercise_chat_agent_pipeline.py
🧰 Additional context used
🪛 LanguageTool
README.MD
[uncategorized] ~323-~323: Loose punctuation mark.
Context: ...lfile. -
PYRIS_LLM_CONFIG_YML_FILE: Path to your
llm_config.yml` file. -...
(UNLIKELY_OPENING_PUNCTUATION)
⏰ Context from checks skipped due to timeout of 90000ms (1)
- GitHub Check: Build and Push Docker Image
🔇 Additional comments (6)
app/pipeline/chat_gpt_wrapper_pipeline.py (1)
88-89
: Duplicate calls toself.callback.done()
may be unintendedThere are two consecutive calls to
self.callback.done()
. The first call does not pass any arguments, while the second passesfinal_result=response
. Unless both calls serve distinct purposes, consider combining them or removing the redundant call.app/domain/status/text_exercise_chat_status_update_dto.py (1)
7-7
: Change to makeresult
optional is appropriateUpdating
result
toOptional[str]
allows for cases where a result may not be available, enhancing the flexibility of theTextExerciseChatStatusUpdateDTO
class.app/web/routers/pipelines.py (1)
239-261
: LGTM! Worker implementation follows established patterns.The implementation of
run_chatgpt_wrapper_pipeline_worker
follows the same error handling and logging patterns as other pipeline workers, which is good for consistency and maintainability.app/web/status/status_update.py (1)
3-3
: LGTM! Enhanced error tracking with Sentry integration.The addition of Sentry SDK for error tracking is a good improvement for monitoring and debugging in production.
README.MD (2)
187-187
: LGTM! Clear warning about model requirements.The warning about requiring models with
gpt_version_equivalent
of 4.5 or higher is crucial information for users setting up the system.
8-25
: LGTM! Improved documentation structure.The enhanced table of contents with detailed subsections improves navigation and readability of the documentation.
Only to be added temporarily as an experiment.
Summary by CodeRabbit
Documentation
llm-config
tollm_config
New Features
Improvements