[Question]: llama-index as a basic interface to openai #8563
-
Question Validation
QuestionHi llama-index team, i have a question to use the llama-index purely as an interface to openai api, as the module offers a lot of heler functions to reduce the code and easy to maintain. In this use case, i don't need any document loading or connector setup, but purely interface the chatgpt and continue to chat by the code something like below.. ` agent = OpenAIAgent....(... 'chatgpt-4' ...) print(agent.chat("Tell me a funny story")) print(agent.chat("What's fun point in the story?")) Above using only openai module needs quite some code. i searched around but couldn't easily find this basic use cases (maybe too basic or not the llama-index target use case.. |
Beta Was this translation helpful? Give feedback.
Replies: 4 comments 1 reply
-
🤖 Hello @jyskim, I'm Dosu, a bot here to assist you with your queries, help solve bugs, and guide you on your journey to becoming a contributor. While we wait for a human maintainer, I'm here to help! I noticed that your question wasn't included in the original post. Could you please provide more details about the issue you're facing or the information you're seeking? This will help me assist you more effectively. Looking forward to your response! This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
Beta Was this translation helpful? Give feedback.
-
Beta Was this translation helpful? Give feedback.
-
Hi
Hi Logan, thank you very much for your reply. The example here doesn't look to maintain the chat history or status.
What i am looking for is from this example. Here the 2nd chat is answered knowing the previous chat.
|
Beta Was this translation helpful? Give feedback.
-
Those examples I linked show you can just pass in the chat history. It's just a list so you could maintain it yourself. You could also use the simple chat engine, which automates the history tracking https://docs.llamaindex.ai/en/stable/examples/chat_engine/chat_engine_repl.html |
Beta Was this translation helpful? Give feedback.
Those examples I linked show you can just pass in the chat history. It's just a list so you could maintain it yourself.
You could also use the simple chat engine, which automates the history tracking
https://docs.llamaindex.ai/en/stable/examples/chat_engine/chat_engine_repl.html