microsoft / microsoft/teams-sdk
[Feature Request]: Enable logging to configurable logging solution
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 729
- Forks
- 270
- Avg merge
- 2d 4h
- Merged PRs (30d)
- 19
Description
Scenario
We want to use Teams-ai for production ready solutions. This means we want to be able to properly use Observability and be able to log the outcome of promptcompletions. We want herefor be able to get the complete result of a prompt completion and be able to log into a production ready logging solution the results of the prompt complete. This will allow us to add metrics for response time, token use etc.
Solution
In the code for js https://github.com/microsoft/teams-ai/blob/dc986b5f9b8ddda7dcc0e5aa21d1e5f5eed252f0/js/packages/teams-ai/src/models/OpenAIModel.ts#L316 there in OpenAIModel.completePrompt the output of the completePrompt is log hardcoded to the console. Also a subset of data is returned (an instance of PromptResponse) with limited data.
There are two possible solutions:
- Allow to inject a custom logger where the logging with be send to instead of logging to console. This is however limited to process the result of the promptcomplete.
- Return te complete result.output instead of a small subset as PromptResponse)
Additional Context
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start in js/packages/teams-ai/src/models/OpenAIModel.ts at OpenAIModel.completePrompt, then inspect how PromptResponse represents the result. Compare the configurable-logger and complete-result options against the observability goals in the issue, including response time and token-use metrics. Done means prompt-completion results can be sent to a production logging solution with the required data.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- backend-api-design, observability
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 32/100