googlecodelabs / feedback

Provide feedback to our codelabs by filing an issue here
18 stars 22 forks source link

[genai-chat-java-palm-langchain4j] Deprecated information #1413

Closed hwangkyle closed 3 months ago

hwangkyle commented 3 months ago

An example of deprecation is in the RAG section:

ConversationalRetrievalChain rag = ConversationalRetrievalChain.builder()
    .chatLanguageModel(model)

    // .retriever and .promptTemplate are deprecated. .retrievalAugmentor is used instead.
    .retriever(retriever)
    .promptTemplate(PromptTemplate.from("""
        Answer to the following query the best as you can: {{question}}
        Base your answer on the information provided below:
        {{information}}
        """
    ))
    .build();

Please update.

glaforge commented 3 months ago

I've stopped maintaining the PaLM / Java codelabs, and I'm now focusing on the Gemini codelab. You can find a similar RAG example here with Gemini, which is not using LangChain4j's deprecated chains: https://github.com/glaforge/gemini-workshop-for-java-developers/blob/main/app/src/main/java/gemini/workshop/RAG.java