Introduction
- playgroundΒ You can see the demo code on the playground.
Set up a fully functional Google Scholar Agent powered by OpenAIβs GPT model in a flash using the Agentica CLI.
Quick CLI Setup
Start the Agentica Setup Wizard with this single command:
npx agentica start google-scholar-agentThe wizard will walk you through:
- Installing required packages (e.g., agentica@0.12.14)
- Choosing your package manager and project type
- Selecting the GOOGLE SCHOLAR controller
- Entering your
OPENAI_API_KEY
Once complete, Agentica automatically generates your code, creates a .env file, and installs all dependencies.
Generated Code Overview
The generated code looks like this:
import { Agentica } from "@agentica/core";
import typia from "typia";
import dotenv from "dotenv";
import { OpenAI } from "openai";
import { GoogleScholarService } from "@wrtnlabs/connector-google-scholar";
dotenv.config();
const agent: Agentica = new Agentica({
vendor: {
api: new OpenAI({ apiKey: process.env.OPENAI_API_KEY! }),
model: "gpt-4o-mini",
},
controllers: [
{
name: "Google Scholar Connector",
protocol: "class",
application: typia.llm.application<GoogleScholarService>(),
execute: new GoogleScholarService({
serpApiKey: process.env.SERP_API_KEY!,
}),
},
],
});
const main = async () => {
console.log(await agent.conversate("What can you do?"));
};
main();This code instantly sets up your Google Scholar Agent, ready to perform intelligent searches on Google Scholar.
What This Does
Your Google Scholar Agent will:
- Process Google Scholar Data: Use the
GoogleScholarServiceconnector. - Leverage OpenAIβs GPT Model: Use OpenAIβs GPT model via the OpenAI SDK.
- Maintain Security: Store your API keys in a
.envfile. - Securely Manage Credentials: Use the
dotenvpackage to manage your API keys.
Set up your environment variables in a .env file:
OPENAI_API_KEY=your-openai-api-key
SERP_API_KEY=your-serp-api-keyMake sure to include your SerpApi API key in the SERP_API_KEY field.
Use Case Example
Imagine asking the agent:
βFind the agentic ai.β
The agent will respond with the most relevant search results from Google Scholar.
Available Functions
For a complete list of functions available in GoogleScholarService, check out the source code.
π wrtnlabs/connectors - GoogleScholarService.tsΒ
Your AI-powered Google Scholar Agent is now ready to help you with your research needs. Enjoy! π