-
Notifications
You must be signed in to change notification settings - Fork 1
Feature/improve summary #24
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
Merged
Merged
Changes from 13 commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
7eecdbd
Update ci workflows
YanickSchraner 5e0a0fc
Common backend structur and standards
YanickSchraner f4d0a0a
Fix dependency injection
YanickSchraner ed14dd9
Use pydantic ai
YanickSchraner 75d3f1f
Refactor summarization and transcription services to use Result types…
YanickSchraner e6003ea
Refactor error handling in summarize and transcribe routes to use Api…
YanickSchraner 3587b2f
Update dependencies and versioning in uv.lock
YanickSchraner bc42515
Update dcc-backend-common dependency to remove fastapi extra and adju…
YanickSchraner 158b3f3
Refactor error handling in summarize and transcribe routes to utilize…
YanickSchraner 70a7dac
Refactor summarize and transcribe route function signatures for impro…
YanickSchraner 56026f1
Refactor transcribe route error handling and enhance application life…
YanickSchraner ad8671d
Enhance error handling in transcribe and summarize routes by updating…
YanickSchraner 470e6dc
Update dcc-backend-common dependency version and adjust related entri…
YanickSchraner c68f9ae
Merge branch 'main' into feature/improve-summary
YanickSchraner File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,8 +1,11 @@ | ||
| LLM_API="http://localhost:9000/v1" | ||
| WHISPER_API="http://localhost:50001/v1" | ||
| API_KEY="your api token here" | ||
| LLM_API_PORT=8001 | ||
| LLM_BASE_URL=http://localhost:${LLM_API_PORT}/v1 | ||
| API_KEY='none' | ||
| WHISPER_URL="http://localhost:50001/v1" | ||
| LLM_MODEL='Qwen/Qwen3-32B-AWQ' | ||
| HMAC_SECRET="YOUR HMAC SECRET" # Used to pseudonymize user id. Create with openssl rand 32 | base64 | ||
| HF_AUTH_TOKEN="" | ||
| CLIENT_PORT=3000 | ||
| CLIENT_URL=http://localhost:${CLIENT_PORT} | ||
| PORT="" | ||
| LLM_HEALTH_CHECK="http://localhost:9000/health" | ||
| WHISPER_HEALTH_CHECK="http://localhost:50001/healthz" | ||
| IS_PROD=False |
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
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
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
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
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
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
This file was deleted.
Oops, something went wrong.
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
Empty file.
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,34 @@ | ||
| from openai import AsyncOpenAI | ||
| from pydantic_ai import Agent, TextOutput | ||
| from pydantic_ai.models.openai import OpenAIChatModel | ||
| from pydantic_ai.providers.openai import OpenAIProvider | ||
|
|
||
| from transcribo_backend.utils.app_config import AppConfig | ||
|
|
||
|
|
||
| def transform_to_swissgerman_style(text: str) -> str: | ||
| return text.replace("ß", "ss") | ||
|
|
||
|
|
||
| def create_summarize_agent(app_config: AppConfig) -> Agent: | ||
| client = AsyncOpenAI(max_retries=3, base_url=app_config.llm_base_url, api_key=app_config.api_key) | ||
| model = OpenAIChatModel(model_name=app_config.llm_model, provider=OpenAIProvider(openai_client=client)) | ||
| summarize_agent: Agent = Agent( | ||
| model=model, | ||
| output_type=TextOutput(transform_to_swissgerman_style), | ||
| ) | ||
|
|
||
| @summarize_agent.instructions | ||
| def get_instructions() -> str: | ||
| return """ | ||
| You are a meeting summary expert. | ||
| You are given a transcript of a meeting and you need to summarize it. | ||
| You need to summarize the meeting in a way that is easy to understand and use. | ||
| You need to include the main points of the meeting, the decisions made, and the action items. | ||
| You need to include the names of the participants. | ||
| You use markdown to format the summary. | ||
| Use the same language as used in the transcript to summarize the meeting. | ||
| If you are not sure about the language, use German. | ||
| """ | ||
|
|
||
| return summarize_agent |
Oops, something went wrong.
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.
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.
🧩 Analysis chain
🏁 Script executed:
Repository: DCC-BS/transcribo-backend
Length of output: 251
🏁 Script executed:
Repository: DCC-BS/transcribo-backend
Length of output: 574
🏁 Script executed:
Repository: DCC-BS/transcribo-backend
Length of output: 921
Update tox.ini and CI matrix to exclude Python 3.10–3.11.
Docker is correctly pinned to
python:3.13-alpine, but the CI matrix in.github/workflows/main.ymlandtox.inistill test Python 3.10 and 3.11, which violate therequires-python = ">=3.12,<3.14"constraint. Removepy310andpy311fromtox.inienvlistand update the CI workflow'spython_versionsto'["3.12","3.13"]'.🤖 Prompt for AI Agents