Giter VIP home page Giter VIP logo

Comments (8)

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024 2

I appreciate your suggestion, but I have decided to stick with JDK 17 because I value the future more.

from langchain-java.

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024

JDK 17 provides many new syntax features, especially the text blocks functionality. I use it to write prompts; otherwise, Java 8 string concatenation would be a nightmare for me.

image

from langchain-java.

wangmiao-1981 avatar wangmiao-1981 commented on August 9, 2024

I think that in many enterprise scenarios, JDK8 still holds a significant share. As I work on banking systems, I consider that the main systems in this field are JDK8-based. If langchain-java can maintain compatibility with JDK8, it would be easier to gain practical application scenarios.

u can try this prompt, it works well for me.

    role: "system",
    content: `

You are a senior JAVA engineer who is very familiar with the syntax differences between JDK17 and JDK8,
and can proficiently convert code between the two.
Please convert the following JDK17 code into JDK8 code.
Do not provide suggestions, just convert the code.
Remember to enclose the converted code in a code block with the md format.
In handling multi-line strings, preserve the original formatting:
`

image

image

from langchain-java.

scorego avatar scorego commented on August 9, 2024

You can integrate Scala with Java 8.

val speech = """Four score and
               |seven years ago""".stripMargin

https://www.oreilly.com/library/view/scala-cookbook/9781449340292/ch01s03.html

from langchain-java.

leonaemsears avatar leonaemsears commented on August 9, 2024

Many enterprises are currently using JDK 8 in their production scenarios.

Using a higher version of JDK may limit the usage scenarios.

I suggest downgrading to JDK 8.

Hi, Did you manage to get the code working with JDK8 ? if so what changes did you make to have it build.

from langchain-java.

wangmiao-1981 avatar wangmiao-1981 commented on August 9, 2024

from langchain-java.

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024

Yes, I am using this project under JDK8, with the main modifications focusing on JDK17's strings and a few features. My approach is to directly compile this project with JDK8, and use GPT to resolve any errors that arise. my prompt is : You are a senior JAVA engineer who is very familiar with the syntax differences between JDK17 and JDK8, and can proficiently convert code between the two. Please convert the following JDK17 code into JDK8 code. Do not provide suggestions, just convert the code. Remember to enclose the converted code in a code block with the md format. In handling multi-line strings, preserve the original formatting: It works well for me. For more details, you can refer to my previous email.

2023年10月2日 21:37,leonaemsears @.***> 写道: Many enterprises are currently using JDK 8 in their production scenarios. Using a higher version of JDK may limit the usage scenarios. I suggest downgrading to JDK 8. Hi, Did you manage to get the code working with JDK8 ? if so what changes did you make to have it build. — Reply to this email directly, view it on GitHub <#65 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AWRVRPCVYIBLZXVTBRLPWFTX5K7TLAVCNFSM6AAAAAA3CZCKMSVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTONBTGAZTIMBVGY. You are receiving this because you authored the thread.

Good prompt,Great Job!

from langchain-java.

HamaWhiteGG avatar HamaWhiteGG commented on August 9, 2024

@wangmiao-1981 I've created a JDK8 branch to support Java 8. Would you be willing to contribute your code? Let's learn and work together.

Currently, @Jashinck is contributing to the JDK8 branch, but it's still in progress. We can maintain Java 8 together.

https://github.com/HamaWhiteGG/langchain-java/tree/jdk8

from langchain-java.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.