Skip to content

Commit b2155d7

Browse files
committed
Add allow-llm-calls attribute, add instructions to use GA keys
1 parent c1b3301 commit b2155d7

File tree

7 files changed

+43
-7
lines changed

7 files changed

+43
-7
lines changed

asciidoc/courses/genai-workshop/modules/1-knowledge-graphs-vectors/lessons/1-getting-started/lesson.adoc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
:disable-cache: true
66

77
We have created a link:https://github.com/neo4j-graphacademy/genai-workshop[repository^] for this workshop.
8-
It contains the starter code and resources you need.
8+
It contains the starter code and resources you need.
99

1010
A blank Neo4j Sandbox instance has also been created for you to use during this course.
1111

@@ -48,7 +48,7 @@ pip install -r requirements.txt
4848

4949
== Setup the environment
5050

51-
Create a copy of the `.env.example` file and name it `.env`.
51+
Create a copy of the `.env.example` file and name it `.env`.
5252
Fill in the required values.
5353

5454
[source]
@@ -57,7 +57,7 @@ Fill in the required values.
5757
include::{repository-raw}/main/.env.example[]
5858
----
5959

60-
Add your Open AI API key (`OPENAI_API_KEY`), which you can get from link:https://platform.openai.com[platformn.openai.com].
60+
Add your Open AI API key (`OPENAI_API_KEY`), which you can get from link:https://platform.openai.com[platform.openai.com].
6161

6262
Update the Neo4j sandbox connection details:
6363

asciidoc/courses/llm-chatbot-python/course.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,11 @@
77
// :video: https://www.youtube.com/embed/vVCHJFa01gA
88
:key-points: Building a Neo4j-backed Chatbot, Neo4j & Langchain, Neo4j & Streamlit
99
:repository: neo4j-graphacademy/llm-chatbot-python
10+
:allow-llm-calls: true
1011

1112
== Course Description
1213

13-
In this hands-on course, you will use the knowledge obtained from the link:/courses/llm-fundamentals[Neo4j & LLM Fundamentals course^] to create a Movie Recommendation Chatbot backed by a Neo4j database.
14+
In this hands-on course, you will use the knowledge from the link:/courses/llm-fundamentals[Neo4j & LLM Fundamentals course^] to create a Movie Recommendation Chatbot backed by a Neo4j database.
1415

1516
You will take a simple chat interface that repeats the user's input and modify it to answer questions about movies via the Neo4j Recommendations Dataset using _GPT 3.5 Turbo_, complete with conversational history.
1617

asciidoc/courses/llm-chatbot-typescript/course.adoc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
:reward-form: https://graphacademy.neo4j.com/account/rewards/llm-chatbot-typescript/
1313
:reward-provider: printful
1414
:reward-product-id: @65f874e831d488,@65f875094279d1
15+
:allow-llm-calls: true
1516

1617
== Course Description
1718
at

asciidoc/courses/llm-fundamentals/course.adoc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
:usecase: recommendations
88
// :video: https://www.youtube.com/embed/vVCHJFa01gA
99
:key-points: Neo4j and Generative AI, Grounding LLMs with Neo4j, Using Neo4j with Langchain
10+
:allow-llm-calls: true
1011

1112
== Course Description
1213

@@ -38,7 +39,7 @@ To complete the practical tasks within this course, you will need an link:https:
3839
=== What you will learn
3940

4041
* Retrieval Augmented Generation (RAG) and its role in grounding LLM generated content
41-
* Using Vector and full text indexes in Neo4j to perform similarity and keyword search
42+
* Using Vector and full-text indexes in Neo4j to perform similarity and keyword search
4243
* Coordinating your LLM interactions with Langchain chains, agents and tools
4344

4445
[.includes]

asciidoc/courses/llm-fundamentals/modules/3-intro-to-langchain/lessons/2-initialising-the-llm/lesson.adoc

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,37 @@ This course includes instructions for using link:https://openai.com/[OpenAI^], b
2020

2121
[NOTE]
2222
.Using OpenAI
23-
If you wish to use OpenAI and follow this course's practical activities, you must create an account and set up billing.
23+
====
24+
We have generated an OpenAI API key for you to use through our OpenAI Proxy for the duration of this course using a proxy.
25+
The API key will be limited to 5 requests every two minutes.
26+
27+
28+
.Environment Variable
29+
[source,env,subs="attributes+"]
30+
----
31+
OPENAI_API_KEY={llm-api-key}
32+
----
33+
34+
You must also set the `base_url` parameter to use our proxy server.
35+
36+
.Setting the Proxy
37+
[source,python,subs="attributes+"]
38+
----
39+
from openai import OpenAI
40+
41+
model = OpenAI(
42+
api_key="{llm-api-key}",
43+
base_url="https://graphacademy.neo4j.com/api/llm/v1/"
44+
)
45+
----
46+
47+
You can always use an existing OpenAI API key and omit the `base_url` argument.
48+
49+
50+
====
51+
52+
53+
2454

2555
== Setup
2656

src/constants.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,4 @@ export const ATTRIBUTE_DESCRIPTION = 'description'
6464
export const ATTRIBUTE_QUESTIONS = 'questions'
6565
export const ATTRIBUTE_PASS_PERCENTAGE = 'pass-percentage'
6666
export const ATTRIBUTE_KEY_POINTS = 'key-points'
67+
export const ATTRIBUTE_ALLOW_LLM_CALLS = 'allow-llm-calls'

src/services/merge-courses.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { Session, ManagedTransaction } from 'neo4j-driver';
55
import { loadFile } from '../modules/asciidoc'
66
import { getDriver } from '../modules/neo4j';
77
import { CourseToImport, LessonToImport, ModuleToImport, QuestionToImport } from '../types';
8-
import { ASCIIDOC_DIRECTORY, ATTRIBUTE_CAPTION, ATTRIBUTE_CATEGORIES, ATTRIBUTE_CERTIFICATION, ATTRIBUTE_CLASSMARKER_ID, ATTRIBUTE_CLASSMARKER_REFERENCE, ATTRIBUTE_DISABLE_CACHE, ATTRIBUTE_DURATION, ATTRIBUTE_LAB, ATTRIBUTE_LANGUAGE, ATTRIBUTE_NEXT, ATTRIBUTE_OPTIONAL, ATTRIBUTE_REDIRECT, ATTRIBUTE_REPOSITORY, ATTRIBUTE_SANDBOX, ATTRIBUTE_STATUS, ATTRIBUTE_THUMBNAIL, ATTRIBUTE_TRANSLATIONS, ATTRIBUTE_REWARD_FORM, ATTRIBUTE_REWARD_IMAGE, ATTRIBUTE_REWARD_PRODUCT_ID, ATTRIBUTE_REWARD_PROVIDER, ATTRIBUTE_TYPE, ATTRIBUTE_UPDATED_AT, ATTRIBUTE_USECASE, ATTRIBUTE_VIDEO, COURSE_DIRECTORY, DEFAULT_COURSE_STATUS, DEFAULT_COURSE_THUMBNAIL, DEFAULT_LANGUAGE, DEFAULT_LESSON_TYPE, STATUS_DISABLED, ATTRIBUTE_REWARD_TYPE, ATTRIBUTE_DESCRIPTION, ATTRIBUTE_QUESTIONS, ATTRIBUTE_PASS_PERCENTAGE, ATTRIBUTE_KEY_POINTS, ATTRIBUTE_BRANCH } from '../constants';
8+
import { ASCIIDOC_DIRECTORY, ATTRIBUTE_CAPTION, ATTRIBUTE_CATEGORIES, ATTRIBUTE_CERTIFICATION, ATTRIBUTE_CLASSMARKER_ID, ATTRIBUTE_CLASSMARKER_REFERENCE, ATTRIBUTE_DISABLE_CACHE, ATTRIBUTE_DURATION, ATTRIBUTE_LAB, ATTRIBUTE_LANGUAGE, ATTRIBUTE_NEXT, ATTRIBUTE_OPTIONAL, ATTRIBUTE_REDIRECT, ATTRIBUTE_REPOSITORY, ATTRIBUTE_SANDBOX, ATTRIBUTE_STATUS, ATTRIBUTE_THUMBNAIL, ATTRIBUTE_TRANSLATIONS, ATTRIBUTE_REWARD_FORM, ATTRIBUTE_REWARD_IMAGE, ATTRIBUTE_REWARD_PRODUCT_ID, ATTRIBUTE_REWARD_PROVIDER, ATTRIBUTE_TYPE, ATTRIBUTE_UPDATED_AT, ATTRIBUTE_USECASE, ATTRIBUTE_VIDEO, COURSE_DIRECTORY, DEFAULT_COURSE_STATUS, DEFAULT_COURSE_THUMBNAIL, DEFAULT_LANGUAGE, DEFAULT_LESSON_TYPE, STATUS_DISABLED, ATTRIBUTE_REWARD_TYPE, ATTRIBUTE_DESCRIPTION, ATTRIBUTE_QUESTIONS, ATTRIBUTE_PASS_PERCENTAGE, ATTRIBUTE_KEY_POINTS, ATTRIBUTE_BRANCH, ATTRIBUTE_ALLOW_LLM_CALLS } from '../constants';
99
import { courseOverviewPath, getDateAttribute, getOrderAttribute } from '../utils';
1010

1111
const loadCourses = (): CourseToImport[] => {
@@ -87,6 +87,7 @@ const loadCourse = (courseFolder: string): CourseToImport => {
8787
classmarkerReference: file.getAttribute(ATTRIBUTE_CLASSMARKER_REFERENCE, null),
8888
questions: file.getAttribute(ATTRIBUTE_QUESTIONS, null),
8989
passPercentage: file.getAttribute(ATTRIBUTE_PASS_PERCENTAGE, null),
90+
allowsLLMCalls: file.getAttribute(ATTRIBUTE_ALLOW_LLM_CALLS, 'false') === 'true',
9091
attributes: {
9192
rewardType: file.getAttribute(ATTRIBUTE_REWARD_TYPE, null),
9293
rewardForm: file.getAttribute(ATTRIBUTE_REWARD_FORM, null),
@@ -216,6 +217,7 @@ const mergeCourseDetails = (tx: ManagedTransaction, courses: CourseToImport[]) =
216217
c.classmarkerReference = course.classmarkerReference,
217218
c.questions = toInteger(course.questions),
218219
c.passPercentage = toInteger(course.passPercentage),
220+
c.allowsLLMCalls = course.allowsLLMCalls,
219221
c += course.attributes
220222
221223
FOREACH (_ IN CASE WHEN course.certification THEN [1] ELSE [] END | SET c:Certification)

0 commit comments

Comments
 (0)