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
479 stars 42 forks source link

PromptLayerOpenAI not working in Sequential Chain #19

Closed edcohen08 closed 1 year ago

edcohen08 commented 1 year ago

I have a chain that's like

llm1 = PromptLayerOpenAI() chain1 = LLMChain(llm=llm, prompt=prompt, output_key="answer1")

llm2 = OpenAI() chain2 = LLMChain(llm=llm, prompt=prompt, output_key="answer2")

full_chain = SequentialChain( chains=[chain1, chain2], input_variables=["query"], output_variables=["answer1, "answer2"]

full_chain({"query": "query"})

My api keys are set up properly but it seems like that full_chain call isn't actually running through PromptLayerOpenAI. The chain is running successfully but seemingly not calling the PromptLayerOpenAI _generate I really like what you guys are building and trying to build something that'd be compatible with it so hopefully can work this out

edcohen08 commented 1 year ago

nvm realized the issue was I was trying to use gpt-3.5-turbo and should have been initializing a PromptLayerOpenAIChat instead