MagnivOrg / prompt-layer-library

🍰 PromptLayer - Maintain a log of your prompts and OpenAI API requests. Track, debug, and replay old completions.
https://www.promptlayer.com
Apache License 2.0
475 stars 42 forks source link

cannot import name 'get_api_key' from 'promptlayer.utils' #159

Closed lfoppiano closed 2 days ago

lfoppiano commented 2 days ago

I'm running promptlayer with the callback from the huggingface:

self.client = HuggingFaceEndpoint(
            repo_id=model_name,
            task="text-generation",
            max_new_tokens=4092,
            do_sample=False,
            temperature=0.01,
            repetition_penalty=1.03,
            callbacks=[PromptLayerCallbackHandler(pl_tags=[model_name, "genshare", "dataseer"])]
        )

and I'm getting cannot import name 'get_api_key' from 'promptlayer.utils' when running it using the version 1.0.6. At first glance in the utility.py the method geT_api_key is not there..

I've installed the following:


promptlayer                   1.0.6
langchain                     0.2.6
langchain-community           0.2.6
langchain-core                0.2.10
langchain-huggingface         0.0.3
langchain-openai              0.1.10
langchain-text-splitters      0.2.2
lfoppiano commented 2 days ago

The issue is an import that should be from langchain_community.callbacks.promptlayer_callback import PromptLayerCallbackHandler