Skip to content
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

Scala direct syntax DSL #66

Merged
merged 6 commits into from
May 17, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Use AIScope.fromCore
nomisRev committed May 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
commit a6289678ec2ac480ee394d8d0a22bb5ab11dcd5e
4 changes: 2 additions & 2 deletions scala/src/main/scala/com/xebia/functional/auto/AI.scala
Original file line number Diff line number Diff line change
@@ -21,7 +21,7 @@ object AI:
LoomAdapter.apply { (cont) =>
AIKt.AIScope[A](
{ (coreAIScope, cont) =>
given AIScope = new AIScope(coreAIScope)
given AIScope = AIScope.fromCore(coreAIScope)
block
},
(e: AIError, cont) => throw AIException(e.getReason),
@@ -36,7 +36,7 @@ final case class AIScope(kt: KtAIScope):

def agent[A](agents: List[ParameterlessAgent[List[String]]], scope: AIScope ?=> A): A = ???

// Scala3 Json parser with support for generating Json Schema?
// TODO: Design signature for Scala3 w/ Json parser (with support for generating Json Schema)?
def prompt[A](
prompt: String,
maxAttempts: Int = 5,