Skip to content

Conversation

softchris
Copy link
Collaborator

Description

Please include a summary of the changes and the related issue. Please also include relevant motivation and context.

Fixes # (issue)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

@leestott leestott requested a review from Copilot October 3, 2025 08:59
Copy link
Contributor

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR introduces an AI framework documentation project that demonstrates how to use LangChain with GitHub Models. The purpose is to provide educational content and code examples for building AI applications using frameworks rather than direct API calls.

Key changes include:

  • Complete documentation explaining AI framework benefits and usage patterns
  • Python code examples demonstrating basic prompting, chat conversations, and tool calling
  • Practical implementations showing integration with external APIs

Reviewed Changes

Copilot reviewed 4 out of 5 changed files in this pull request and generated 10 comments.

File Description
10-ai-framework-project/README.md Comprehensive documentation covering AI frameworks, LangChain usage, and detailed code examples
10-ai-framework-project/code/python/app.py Basic LangChain implementation for simple prompting
10-ai-framework-project/code/python/app-chat.py Chat conversation example with message history
10-ai-framework-project/code/python/app-tools.py Tool calling implementation with external API integration

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@@ -0,0 +1,374 @@
# AI Framework

There are many AI frameworks out there that when used can severly quicken up the time it takes to build a project. In this project we will focus on understanding what problems these frameworks address and build such a project ourselves.
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'severly' to 'severely'.

Suggested change
There are many AI frameworks out there that when used can severly quicken up the time it takes to build a project. In this project we will focus on understanding what problems these frameworks address and build such a project ourselves.
There are many AI frameworks out there that when used can severely quicken up the time it takes to build a project. In this project we will focus on understanding what problems these frameworks address and build such a project ourselves.

Copilot uses AI. Check for mistakes.


- **No SDK**, most AI models allows you to interact directly with the AI model via for example HTTP requests. That approach works and may sometimes be your only option if an SDK option is missing.
- **SDK**. Using an SDK is usually the recommended approach as it allows you to type less code to interact with your model. It usually is limited to a specific model and if using different models, you might need to write new code to support those additional models.
- **A framework**. A framework usually takes things to another level in the sense that if you need to use different models, there's one API for all of them, what differs is usually the initial set up. Additionally frameworks brings in useful abstractions like in the AI space, they can deal with tools, memory, workflows, agents and more while writing less code. Because frameworks are usually opinionated they can really be helpful if you buy into how they do things but may fall short if you try to do something bespoke that the framework isn't made for. Sometimes a framework can also simplify too much and you may therefore not learn an important topic that later may harm perfomance for example.
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'perfomance' to 'performance'.

Suggested change
- **A framework**. A framework usually takes things to another level in the sense that if you need to use different models, there's one API for all of them, what differs is usually the initial set up. Additionally frameworks brings in useful abstractions like in the AI space, they can deal with tools, memory, workflows, agents and more while writing less code. Because frameworks are usually opinionated they can really be helpful if you buy into how they do things but may fall short if you try to do something bespoke that the framework isn't made for. Sometimes a framework can also simplify too much and you may therefore not learn an important topic that later may harm perfomance for example.
- **A framework**. A framework usually takes things to another level in the sense that if you need to use different models, there's one API for all of them, what differs is usually the initial set up. Additionally frameworks brings in useful abstractions like in the AI space, they can deal with tools, memory, workflows, agents and more while writing less code. Because frameworks are usually opinionated they can really be helpful if you buy into how they do things but may fall short if you try to do something bespoke that the framework isn't made for. Sometimes a framework can also simplify too much and you may therefore not learn an important topic that later may harm performance for example.

Copilot uses AI. Check for mistakes.


## Chat conversation

In the preceeding section, you saw how we used what's normally known as zero shot prompting, a single prompt followed by a response.
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'preceeding' to 'preceding'.

Suggested change
In the preceeding section, you saw how we used what's normally known as zero shot prompting, a single prompt followed by a response.
In the preceding section, you saw how we used what's normally known as zero shot prompting, a single prompt followed by a response.

Copilot uses AI. Check for mistakes.


In the preceeding section, you saw how we used what's normally known as zero shot prompting, a single prompt followed by a response.

However, often you find yourselse in a situation where you need to maintain a conversation of several messages being exchanged between yourself and the AI assistant.
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'yourselse' to 'yourself'.

Suggested change
However, often you find yourselse in a situation where you need to maintain a conversation of several messages being exchanged between yourself and the AI assistant.
However, often you find yourself in a situation where you need to maintain a conversation of several messages being exchanged between yourself and the AI assistant.

Copilot uses AI. Check for mistakes.


```python
messages = [
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Startship' to 'Starship'.

Suggested change
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
SystemMessage(content="You are Captain Picard of the Starship Enterprise"),

Copilot uses AI. Check for mistakes.

)

messages = [
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Startship' to 'Starship'.

Copilot uses AI. Check for mistakes.

)

messages = [
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Startship' to 'Starship'.

Suggested change
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
SystemMessage(content="You are Captain Picard of the Starship Enterprise"),

Copilot uses AI. Check for mistakes.

}
```

What we're doing here is to create a description of a tool called `add`. By inheriting from `TypedDict` and adding members like `a` and `b` of type `Annotated` this can be converted to a schema that the LLM can understand. Ther creation of functions is a dictionary that ensures that we know what to do if a specific tool is identified.
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Ther' to 'The'.

Suggested change
What we're doing here is to create a description of a tool called `add`. By inheriting from `TypedDict` and adding members like `a` and `b` of type `Annotated` this can be converted to a schema that the LLM can understand. Ther creation of functions is a dictionary that ensures that we know what to do if a specific tool is identified.
What we're doing here is to create a description of a tool called `add`. By inheriting from `TypedDict` and adding members like `a` and `b` of type `Annotated` this can be converted to a schema that the LLM can understand. The creation of functions is a dictionary that ensures that we know what to do if a specific tool is identified.

Copilot uses AI. Check for mistakes.

print("CONTENT: ",res.content)
```

Running this coode, you should see output similar to:
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'coode' to 'code'.

Suggested change
Running this coode, you should see output similar to:
Running this code, you should see output similar to:

Copilot uses AI. Check for mistakes.

)

messages = [
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
Copy link
Preview

Copilot AI Oct 3, 2025

Choose a reason for hiding this comment

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

Corrected spelling of 'Startship' to 'Starship'.

Suggested change
SystemMessage(content="You are Captain Picard of the Startship Enterprise"),
SystemMessage(content="You are Captain Picard of the Starship Enterprise"),

Copilot uses AI. Check for mistakes.

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.

1 participant