microsoft / microsoft/teams-sdk

[Feature Request]: Enable logging to configurable logging solution

Open
#2,002 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

enhancement JS & dotnet & Python P1
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:

  1. 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.
  2. Return te complete result.output instead of a small subset as PromptResponse)
Additional Context

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.