-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
AI DSL From Scala examples #107
Conversation
scala/src/main/scala/com/xebia/functional/examples/auto/ChessAI.scala
Outdated
Show resolved
Hide resolved
@Yawolf is this ready for final review? |
The code is done, but the LLM is returning a wrong value in the |
Rebased on top on latest main. Will have a look at open comments, so we can get it ready for review. |
With this latest change 767ef8b , I unblock the game start and get it going. I start seeing:
Is this a known issue? Also, does this example work in Kotlin? |
@necosta The Chess example never worked reliably in kotlin. Some of the other simpler examples should be fine for now. In the last 4 days, even simple examples have failed for me due to Open AI server errors like 502 and others—also many timeouts like that. |
How to run (IntelliJ IDEA):
|
@necosta should we put the run instructions somewhere in a README? |
Yes, I'll add them in this new PR I'm creating. |
private final case class Story(animal: Animal, invention: Invention, story: String) derives ScalaSerialDescriptor, Decoder | ||
|
||
@main def runAnimal: Unit = | ||
AI { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For consistency with the Kotlin DSL, unless we think this is more idiomatic in Scala, we should have AI
be ai
and ensure all other functions are named the same in Scala.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Sounds good. Let's tackle this in a separate PR
@@ -1,6 +1,6 @@ | |||
package com.xebia.functional.xef.scala.auto | |||
|
|||
import com.xebia.functional.auto.* | |||
import com.xebia.functional.scala.auto.* | |||
import com.xebia.functional.scala.auto.ScalaSerialDescriptor |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are missing xef
in the package.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fixing this in a separate PR
CC @necosta
Adding some basic examples that don't require nested case classes for proving AI functionality in Scala.
2023-05-26 update:
Animal
working without issuesBook
working without issuesChessAI
showing HttpRequestTimeoutException on the 3rd/4th playASCIIArt
removing it for now, will come in a new PRReady for review.