Skip to content

Commit

Permalink
Merge pull request #684 from polywrap/release/staging
Browse files Browse the repository at this point in the history
Release Jan 4th
  • Loading branch information
dOrgJelli authored Jan 4, 2024
2 parents c74bca3 + d91a2ef commit d2d23e0
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 74 deletions.
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@ What makes evo.ninja special is that it adapts itself in real-time, based on the

### Execution Loop

![](apps/browser/public/arch-diagram-w-logo.png)

1. **Predict Next Step:** For each iteration of the execution loop, Evo starts by making an informed prediction about what the best-next-step should be.
2. **Select Best Agent:** Based on this prediction, Evo selects a best-fit agent persona.
3. **Contextualize Chat History:** Based on the prediction from step 1, and the agent persona in step 2, the complete chat history is "contextualized" and only the most relevant messages are used for the final evaluation step.
Expand Down
157 changes: 94 additions & 63 deletions apps/browser/components/modals/WelcomeModal.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
import React from "react";
import Modal from "./ModalBase";
import Button from "../Button";
import { ArrowRight, SignOut } from "@phosphor-icons/react";
import Image from "next/image";
import { signIn, signOut, useSession } from "next-auth/react";
import { useAccountConfig } from "@/lib/hooks/useAccountConfig";
import AccountConfig from "./AccountConfig";

export const WELCOME_MODAL_SEEN_STORAGE_KEY = "welcome-modal-seen";
import Logo from "@/components/Logo";
import { ArrowRight } from "@phosphor-icons/react";
import Image from "next/image";
import { signIn, useSession } from "next-auth/react";

interface WelcomeModalProps {
isOpen: boolean;
Expand All @@ -19,68 +18,100 @@ export default function WelcomeModal(props: WelcomeModalProps) {
const { isOpen, onClose } = props;
const { onSave, error, setApiKey, apiKey, setTelemetry, telemetry } =
useAccountConfig({ onClose });
const [sigInFlow, setSignInFlow] = React.useState(false);

return (
const IntroFlow = (
<>
<Modal isOpen={isOpen} title="Welcome to Evo Ninja" onClose={onClose}>
{session?.user?.email ? (
<div className="space-y-6">
<div className="border-b-2 border-zinc-700 pb-8 text-center">
You're signed in!
</div>
<div className="relative flex h-full w-full flex-col items-center justify-center w-full">
<div className="text-center">
evo.ninja is a generalist AI agent with a unique<br/>chameleon architecture:
</div>
<img src="/arch-diagram-w-logo.png" alt="Architecture" className="w-64 h-auto pb-6" />
<div className="text-center">
Created by the <a href="https://polywrap.io" target="_blank" className="text-cyan-500">Polywrap</a> team, evo.ninja won<br/>"Best Generalist
Agent" from AutoGPT.
</div>
<img src="/polywrap-award.png" alt="Award" className="w-32 h-auto pb-6 pt-6" />
<div className="text-center">
Join our <a href="https://discord.gg/r3rwh69cCa" target="_blank" className="text-cyan-500">discord</a> and <a href="https://blog.polywrap.io" target="_blank" className="text-cyan-500">substack</a> to learn and
stay<br/>informed with our latest creations!
</div>
</div>
<div className="flex justify-end pt-8">
<Button onClick={() => setSignInFlow(true)}>
<div>Try Evo</div>
<ArrowRight size={16} color="white" />
</Button>
</div>
</>
)

const SignInFlow = (
<>
{session?.user?.email ? (
<div className="space-y-6">
<div className="border-b-2 border-zinc-700 pb-8 text-center">
You're signed in!
</div>
) : (
<>
<div className="border-b-2 border-zinc-700 pb-8 text-center">
Evo is an agent that can do many things. This is a technical
preview, feedback and questions are appreciated!
</div>
<div className="space-y-6 border-b-2 border-zinc-700 pb-8">
<p>Sign in below to save your sessions</p>
<div className="space-y-2">
<Button
className="w-full"
hierarchy="secondary"
onClick={() => signIn("github")}
>
<Image
alt="Sign in with Github"
width={20}
height={20}
src="/github-logo.svg"
/>
<div>Sign in with Github</div>
</Button>
<Button
className="w-full"
hierarchy="secondary"
onClick={() => signIn("google")}
>
<Image
alt="Sign in with Google"
width={20}
height={20}
src="/google-logo.svg"
/>
<div>Sign in with Google</div>
</Button>
</div>
</div>
</>
)}
<AccountConfig
setApiKey={setApiKey}
apiKey={apiKey}
telemetry={telemetry}
setTelemetry={setTelemetry}
error={error}
/>
<div className="flex justify-end border-t-2 border-zinc-700 pt-8">
<Button onClick={onSave}>
<div>Get Started</div>
<ArrowRight size={16} color="white" />
</Button>
</div>
) : (
<>
<div className="border-b-2 border-zinc-700 pb-8 text-center">
This is a technical preview, feedback and questions are appreciated!
</div>
<div className="space-y-6 border-b-2 border-zinc-700 pb-8">
<p>Sign in below to save your sessions</p>
<div className="space-y-2">
<Button
className="w-full"
hierarchy="secondary"
onClick={() => signIn("github")}
>
<Image
alt="Sign in with Github"
width={20}
height={20}
src="/github-logo.svg"
/>
<div>Sign in with Github</div>
</Button>
<Button
className="w-full"
hierarchy="secondary"
onClick={() => signIn("google")}
>
<Image
alt="Sign in with Google"
width={20}
height={20}
src="/google-logo.svg"
/>
<div>Sign in with Google</div>
</Button>
</div>
</div>
</>
)}
<AccountConfig
setApiKey={setApiKey}
apiKey={apiKey}
telemetry={telemetry}
setTelemetry={setTelemetry}
error={error}
/>
<div className="flex justify-end border-t-2 border-zinc-700 pt-8">
<Button onClick={onSave}>
<div>Get Started</div>
<ArrowRight size={16} color="white" />
</Button>
</div>
</>
);

return (
<>
<Modal isOpen={isOpen} title="Welcome to Evo Ninja" onClose={onClose}>
{sigInFlow ? SignInFlow : IntroFlow}
</Modal>
</>
);
Expand Down
Binary file added apps/browser/public/arch-diagram-w-logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added apps/browser/public/polywrap-award.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 3 additions & 11 deletions packages/agents/src/agents/Developer/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ReadFileFunction } from "../../functions/ReadFile";
import { AgentContext } from "@/agent-core";
import { InitPoetryFunction } from "../../functions/InitPoetry";
import { prompts } from "./prompts";
import { RunPytest } from "../../functions/RunPytest";
import { WriteFileFunction } from "../../functions/WriteFile";
import { ReadDirectoryFunction } from "../../functions";
import { prompts } from "./prompts";
import { Agent, AgentConfig } from "../utils";

export class DeveloperAgent extends Agent {
Expand All @@ -16,20 +16,12 @@ export class DeveloperAgent extends Agent {
new WriteFileFunction(context.scripts),
new ReadFileFunction(context.scripts),
new ReadDirectoryFunction(context.scripts),
new RunPytest(),
new InitPoetryFunction(),
/*new RunPytest(),
new InitPoetryFunction(),*/
],
context.scripts
),
context
);
}
}

/* public override async onFirstRun(args: GoalRunArgs, chat: Chat): Promise<void> {
await Promise.all([
this.executeFunction(new InitPoetryFunction(), {}, chat),
this.executeFunction(new PlanDevelopmentFunction(), args, chat)
]);
return Promise.resolve();
}*/
2 changes: 2 additions & 0 deletions packages/agents/src/agents/Evo/findBestAgent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { FunctionDefinition, Rag, ArrayRecombiner } from "@/agent-core";
import { AgentContext } from "@/agent-core";
import { AgentFunctionBase } from "../../functions/utils";
import { Agent, GoalRunArgs } from "../utils/Agent";
import { DeveloperAgent } from "../Developer";
import { CsvAnalystAgent } from "../CsvAnalyst";
import { ResearcherAgent } from "../Researcher";
import { SynthesizerAgent } from "../Synthesizer";
Expand All @@ -27,6 +28,7 @@ export const findBestAgent = async (
AgentFunctionBase<unknown>[]
]> => {
const allAgents: Agent[] = [
DeveloperAgent,
CsvAnalystAgent,
ResearcherAgent,
SynthesizerAgent,
Expand Down

0 comments on commit d2d23e0

Please sign in to comment.