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

feat: Max token Setting #315

Merged
merged 1 commit into from
Apr 22, 2023
Merged

feat: Max token Setting #315

merged 1 commit into from
Apr 22, 2023

Conversation

awtkns
Copy link
Member

@awtkns awtkns commented Apr 22, 2023

No description provided.

@vercel
Copy link

vercel bot commented Apr 22, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
agent-gpt ✅ Ready (Inspect) Visit Preview Apr 22, 2023 3:15pm

@@ -76,7 +84,7 @@ const Input = (props: InputProps) => {
inputElement = (
<textarea
className={clsx(
"border:black delay-50 w-full resize-none h-20 rounded-xl bg-[#3a3a3a] text-sm tracking-wider outline-0 transition-all placeholder:text-white/20 hover:border-[#1E88E5]/40 focus:border-[#1E88E5] py-3 md:text-lg border-[2px] border-white/10 px-2",
"border:black delay-50 h-20 w-full resize-none rounded-xl border-[2px] border-white/10 bg-[#3a3a3a] px-2 py-3 text-sm tracking-wider outline-0 transition-all placeholder:text-white/20 hover:border-[#1E88E5]/40 focus:border-[#1E88E5] md:text-lg",
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

automatic re-order

close();
const updateSettings = <Key extends keyof ModelSettings>(
key: Key,
value: ModelSettings[Key]
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

generics 😍

openAIApiKey: _settings?.customApiKey || process.env.OPENAI_API_KEY,
temperature: _settings?.customTemperature || 0.9,
modelName: _settings?.customModelName || GPT_35_TURBO,
maxTokens: _settings?.maxTokens || 400,
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is cleaner now

customModelName: GPT_35_TURBO,
customTemperature: 0.9,
customMaxLoops: DEFAULT_MAX_LOOPS_FREE,
maxTokens: 400,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we make these constants


const handleNewGoal = () => {
const agent = new AutonomousAgent(
name.trim(),
goalInput.trim(),
handleAddMessage,
() => setAgent(null),
{ customApiKey, customModelName, customTemperature, customMaxLoops },
customSettings[0],
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we extract these from the array

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree, this is actually just an array of two, [settings, setSettings]

@awtkns awtkns merged commit cff1554 into main Apr 22, 2023
@awtkns awtkns deleted the settings branch May 3, 2023 14:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants