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

Bugs in conversations #260

Merged
merged 16 commits into from
Jul 27, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
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
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ interface Chat : LLM {
Message(role = role, content = firstChoice.message?.content ?: "", name = role.name),
timestamp = getTimeMillis()
)
context.addMemories(listOf(requestMemory, firstChoiceMemory))
context.addMemories(listOf(firstChoiceMemory, requestMemory))
}
}

Expand All @@ -268,7 +268,7 @@ interface Chat : LLM {
Message(role = role, content = firstChoice.message?.content ?: "", name = role.name),
timestamp = getTimeMillis()
)
context.addMemories(listOf(requestMemory, firstChoiceMemory))
context.addMemories(listOf(firstChoiceMemory, requestMemory))
}
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
package com.xebia.functional.xef.auto

import com.xebia.functional.xef.auto.llm.openai.getOrElse
import com.xebia.functional.xef.auto.llm.openai.promptMessage

suspend fun main() {
ai {

val email: String =
promptMessage(
"""
|You are a Marketing Responsible and have the information about different products. You have to prepare
|an email template with the personal information
""".trimMargin()
)
println("First question:\n $email")
javipacheco marked this conversation as resolved.
Show resolved Hide resolved

val summarize: String =
promptMessage(
"""
|You are a Marketing Responsible and have the information about the best rated products.
|Summarize the next information:
|Love this product and so does my husband! He tried it because his face gets chapped and red from
|working outside. It actually helped by about 60%! I love it cuz it's lightweight and smells so yummy!
|After applying makeup, it doesn't leave streaks like other moisturizers cause. i would definitely use
|this!
|
|I've been using this for 10+yrs now. I don't have any noticeable
|wrinkles at all. I use Estée Lauder's micro essence then advance repair serum before I apply this
|lotion. A little goes a long way! It does feel greasier than most face lotions that I've tried
|previously but I don't apply much. I enjoy cucumber like scent of the face lotion. I have combination
|skin and never broke out using this. This is my daily skincare product with or without makeup. And it
|has SPF but I also apply Kravebeauty SPF on top as well for extra protection
""".trimMargin()
)
println("Second question:\n $summarize")


}.getOrElse { println(it) }
}