langchain icon indicating copy to clipboard operation
langchain copied to clipboard

Usage Details is not coming for OpenAiAssistantRunnable.

Open Smit3949 opened this issue 1 year ago • 1 comments

Checked other resources

  • [X] I added a very descriptive title to this issue.
  • [X] I searched the LangChain documentation with the integrated search.
  • [X] I used the GitHub search to find a similar question and didn't find it.
  • [X] I am sure that this is a bug in LangChain rather than my code.
  • [X] The bug is not resolved by updating to the latest stable version of LangChain (or the specific integration package).

Example Code


OpenAIAssistantFinish(
                return_values={
                    "output": answer,
                    "thread_id": run.thread_id,
                    "run_id": run.id,
                },
                log="",
                run_id=run.id,
                thread_id=run.thread_id,
            ) 

this only return following fields, it should return usage details as well

Error Message and Stack Trace (if applicable)

No response

Description

I want to charge user on based on tokens and im using open ai assistant but its not returning usage details so even call backs does not have any usage details as well.

System Info

System Information

OS: Darwin OS Version: Darwin Kernel Version 24.0.0: Mon Aug 12 20:54:26 PDT 2024; root:xnu-11215.1.10~2/RELEASE_ARM64_T8112 Python Version: 3.11.6 (v3.11.6:8b6ee5ba3b, Oct 2 2023, 11:18:21) [Clang 13.0.0 (clang-1300.0.29.30)]

Package Information

langchain_core: 0.3.18 langchain: 0.3.7 langchain_community: 0.3.7 langsmith: 0.1.142 langchain_chroma: 0.1.4 langchain_google_genai: 2.0.6 langchain_openai: 0.2.6 langchain_text_splitters: 0.3.2 langchain_unstructured: 0.1.5

Optional packages not installed

langgraph langserve

Other Dependencies

aiohttp: 3.10.10 async-timeout: Installed. No version info available. chromadb: 0.5.18 dataclasses-json: 0.6.7 fastapi: 0.115.5 filetype: 1.2.0 google-generativeai: 0.8.3 httpx: 0.27.0 httpx-sse: 0.4.0 jsonpatch: 1.33 numpy: 1.26.4 openai: 1.54.3 orjson: 3.10.11 packaging: 24.2 pydantic: 2.9.2 pydantic-settings: 2.6.1 PyYAML: 6.0.2 requests: 2.32.3 requests-toolbelt: 1.0.0 SQLAlchemy: 2.0.35 tenacity: 9.0.0 tiktoken: 0.8.0 typing-extensions: 4.12.2 unstructured-client: 0.25.9 unstructured[all-docs]: Installed. No version info available.

Smit3949 avatar Dec 26 '24 11:12 Smit3949

Hey @hwchase17, @efriis could you please take a look at this issue?

Smit3949 avatar Dec 26 '24 11:12 Smit3949

Hi, @Smit3949. I'm Dosu, and I'm helping the LangChain team manage their backlog. I'm marking this issue as stale.

Issue Summary:

  • You reported a bug in the LangChain library with OpenAiAssistantRunnable not returning usage details.
  • This issue affects charging users based on token usage.
  • The problem persists even after updating to the latest version.
  • You have verified it as a bug and requested attention from maintainers @hwchase17 and @efriis.

Next Steps:

  • Please confirm if this issue is still relevant to the latest version of the LangChain repository. If so, you can keep the discussion open by commenting here.
  • Otherwise, this issue will be automatically closed in 7 days.

Thank you for your understanding and contribution!

dosubot[bot] avatar Mar 27 '25 16:03 dosubot[bot]