Y o u r A I p a i r p r o g r a m m e r
G i t H u b C o p i l o t u s e s t h e O p e n A I C o d e x t o s u g g e s t c o d e a n d e n t i r e f u n c t i o n s i n r e a l - t i m e , r i g h t f r o m y o u r e d i t o r .
S t a r t m y f r e e t r i a l
E x p l o r e d o c s
T y p e S c r i p t
s e n t i m e n t s . t s
Go
w r i t e _ s q l . g o
P y t h o n
p a r s e _ e x p e n s e s . p y
R u b y
a d d r e s s e s . r b
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env ts-node
import { fetch } from "fetch-h2" ;
// Determine whether the sentiment of text is positive
// Use a web service
async function isPositive ( text : string ) : Promise < boolean > {
const response = await fetch ( `http://text-processing.com/api/sentiment/` , {
method : "POST" ,
body : `text=${ text } ` ,
headers : {
"Content-Type" : "application/x-www-form-urlencoded" ,
} ,
} ) ;
const json = await response . json ( ) ;
return json . label === "pos" ;
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
type CategorySummary struct {
Title string
Tasks int
AvgValue float64
}
func createTables (db * sql.DB ) {
db .Exec ("CREATE TABLE tasks (id INTEGER PRIMARY KEY, title TEXT, value INTEGER, category TEXT)" )
}
func createCategorySummaries (db * sql.DB ) ([]CategorySummary , error ) {
var summaries []CategorySummary
rows , err := db .Query ("SELECT category, COUNT(category), AVG(value) FROM tasks GROUP BY category" )
if err != nil {
return nil , err
}
defer rows .Close ()
for rows .Next () {
var summary CategorySummary
err := rows .Scan (& summary .Title , & summary .Tasks , & summary .AvgValue )
if err != nil {
return nil , err
}
summaries = append (summaries , summary )
}
return summaries , nil
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
import datetime
def parse_expenses (expenses_string ):
"""Parse the list of expenses and return the list of triples (date, value, currency).
Ignore lines starting with #.
Parse the date using datetime.
Example expenses_string:
2016-01-02 -34.01 USD
2016-01-03 2.59 DKK
2016-01-03 -2.72 EUR
"""
expenses = []
for line in expenses_string .splitlines ():
if line .startswith ("#" ):
continue
date , value , currency = line .split (" " )
expenses .append ((datetime .datetime .strptime (date , "%Y-%m-%d" ),
float (value ),
currency ))
return expenses
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class CreateShippingAddresses < ActiveRecord ::Migration
def change
create_table :shipping_addresses do |t |
t . string :name
t . string :address
t . string :city
t . string :zip
t . string :state
t . string :phone
t . string :email
t . references :shipping_method , index : true , foreign_key : true
t . references :customer , index : true , foreign_key : true
t . timestamps null : false
end
end
end
C o p i l o t
R e p l a y
T r a i n e d o n b i l l i o n s o f l i n e s o f c o d e , G i t H u b C o p i l o t t u r n s n a t u r a l l a n g u a g e p r o m p t s i n t o c o d i n g s u g g e s t i o n s a c r o s s d o z e n s o f l a n g u a g e s .
F o c u s o n s o l v i n g b i g g e r p r o b l e m s
S p e n d l e s s t i m e c r e a t i n g b o i l e r p l a t e a n d r e p e t i t i v e c o d e p a t t e r n s , a n d m o r e t i m e o n w h a t m a t t e r s : b u i l d i n g g r e a t s o f t w a r e . W r i t e a c o m m e n t d e s c r i b i n g t h e l o g i c y o u w a n t a n d G i t H u b C o p i l o t w i l l i m m e d i a t e l y s u g g e s t c o d e t o i m p l e m e n t t h e s o l u t i o n .
Go
r u n t i m e . g o
R u b y
c o u r s e . r b
J a v a S c r i p t
t i m e . j s
J a v a
I s P r i m e T e s t . j a v a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
package main
type Run struct {
Time int // in milliseconds
Results string
Failed bool
}
// Get average runtime of successful runs in seconds
func averageRuntimeInSeconds (runs []Run ) float64 {
var totalTime int
var failedRuns int
for _ , run := range runs {
if run .Failed {
failedRuns ++
} else {
totalTime += run .Time
}
}
averageRuntime := float64 (totalTime ) / float64 (len (runs ) - failedRuns ) / 1000
return averageRuntime
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
class Course < ApplicationRecord
has_many :enrollments , dependent : :destroy
has_many :students , through : :enrollments , source : :user
has_many :teachers , through : :enrollments , source : :user
has_many :assignments , dependent : :destroy
has_many :submissions , through : :assignments
validates :name , presence : true
validates :start_date , presence : true
validates :end_date , presence : true
validates :term , presence : true
validates :year , presence : true
def self . find_by_name ( name )
Course . find_by ( name : name )
end
end
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
const seconds = 3600
const minutes = seconds / 60
const hours = minutes / 60
const days = hours / 24
const weeks = days / 7
const months = days / 30
const years = months / 12
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import static org .junit .Assert .*;
import org .junit .Test ;
public class IsPrimeTest {
// Math.isPrime(int) returns whether the given number is prime or not
@ Test
public void testIsPrime () {
assertTrue (Math .isPrime (2 ));
assertTrue (Math .isPrime (3 ));
assertTrue (Math .isPrime (5 ));
assertTrue (Math .isPrime (7 ));
assertTrue (Math .isPrime (11 ));
assertTrue (Math .isPrime (13 ));
assertTrue (Math .isPrime (17 ));
assertTrue (Math .isPrime (19 ));
assertTrue (Math .isPrime (23 ));
assertTrue (Math .isPrime (29 ));
}
C o p i l o t
R e p l a y
G e t A I - b a s e d s u g g e s t i o n s , j u s t f o r y o u
G i t H u b C o p i l o t s h a r e s r e c o m m e n d a t i o n s b a s e d o n t h e p r o j e c t ' s c o n t e x t a n d s t y l e c o n v e n t i o n s . Q u i c k l y c y c l e t h r o u g h l i n e s o f c o d e , c o m p l e t e f u n c t i o n s u g g e s t i o n s , a n d d e c i d e w h i c h t o a c c e p t , r e j e c t , o r e d i t .
P r e v i o u s
N e x t
A c c e p t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
def max_sum_slice (xs ):
max_ending = max_so_far = 0
for x in xs :
max_ending = max (0 , max_ending + x )
max_so_far = max (max_so_far , max_ending )
return max_so_far
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
def max_sum_slice (xs ):
if not xs :
return 0
max_ending = max_slice = 0
for x in xs :
max_ending = max (0 , max_ending + x )
max_slice = max (max_slice , max_ending )
return max_slice
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
10
11
12
13
def max_sum_slice (xs ):
max_ending = max_so_far = 0
begin = end = 0
for i , x in enumerate (xs ):
if max_ending + x > 0 :
max_ending += x
else :
max_ending = 0
begin = i
if max_ending > max_so_far :
max_so_far = max_ending
end = i
return begin , end , max_so_far
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
10
11
12
def max_sum_slice (xs ):
if not xs :
return 0
current_max = 0
max_so_far = 0
for x in xs :
current_max = max (0 , current_max + x )
max_so_far = max (max_so_far , current_max )
return max_so_far
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
def max_sum_slice (xs ):
max_sum = 0
max_sum_so_far = 0
start_index = 0
end_index = 0
for i in range (len (xs )):
max_sum_so_far += xs [i ]
if max_sum_so_far > max_sum :
max_sum = max_sum_so_far
start_index = i
end_index = i
elif max_sum_so_far < 0 :
max_sum_so_far = 0
start_index = i
else :
end_index = i
return (start_index , end_index , max_sum )
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def max_sum_slice (xs ):
if len (xs ) == 0 :
return 0
max_sum = 0
max_sum_ending_here = 0
max_ending_here = 0
for x in xs :
max_ending_here = max (0 , max_ending_here + x )
max_sum_ending_here = max (max_sum_ending_here , max_ending_here )
max_sum = max (max_sum , max_sum_ending_here )
return max_sum
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
10
11
12
13
def max_sum_slice (xs ):
best_sum , best_start , best_end = 0 , None , None
for i , x in enumerate (xs ):
if best_start is None or best_sum < x + best_sum :
best_sum = x + best_sum
best_start = i
best_end = i
elif best_sum > x + best_sum :
best_sum = x + best_sum
best_end = i
return best_sum , best_start , best_end
C o p i l o t
V i s u a l S t u d i o C o d e
P y t h o n
m a x _ s u m _ s l i c e . p y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
def max_sum_slice (xs ):
"""
Return a tuple (i,j) where i is the index of the first slice with a max value,
and j is the index of the slice whose sum is the max
"""
if len (xs ) == 0 :
return None
elif len (xs ) == 1 :
return (0 ,0 )
elif len (xs ) == 2 :
return (0 ,1 ) if xs [0 ] >= xs [1 ] else (1 ,0 )
else :
return max_sum_slice_helper (xs ,0 ,len (xs )- 1 )
C o p i l o t
K e e p f l y i n g w i t h y o u r f a v o r i t e e d i t o r
G i t H u b C o p i l o t i n t e g r a t e s d i r e c t l y i n t o y o u r e d i t o r i n c l u d i n g N e o v i m , J e t B r a i n s I D E s , V i s u a l S t u d i o , a n d V i s u a l S t u d i o C o d e — a n d i s f a s t e n o u g h t o u s e a s y o u t y p e .
V i s u a l S t u d i o
N e o v i m
V S C o d e
J e t B r a i n s I D E s
C o d e c o n f i d e n t l y i n u n f a m i l i a r t e r r i t o r y
W h e t h e r y o u ’ r e w o r k i n g i n a n e w l a n g u a g e o r f r a m e w o r k , o r j u s t l e a r n i n g t o c o d e , G i t H u b C o p i l o t c a n h e l p y o u f i n d y o u r w a y . T a c k l e a b u g , o r l e a r n h o w t o u s e a n e w f r a m e w o r k w i t h o u t s p e n d i n g m o s t o f y o u r t i m e s p e l u n k i n g t h r o u g h t h e d o c s o r s e a r c h i n g t h e w e b .
D r a w a s c a t t e r p l o t
M e m o i z a t i o n
G o o d r e a d s r a t i n g
n
f e t c h _ t w e e t s . p y
e t s . r b
s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
const token = process . env [ "TWITTER_BEARER_TOKEN" ]
const fetchTweetsFromUser = async ( screenName , count ) => {
const response = await fetch (
`https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=${ screenName } &count=${ count } ` ,
{
headers : {
Authorization : `Bearer ${ token } ` ,
} ,
}
)
const json = await response . json ( )
return json
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
import tweepy , os # secrets in environment variables
def fetch_tweets_from_user (user_name ):
# authentification
auth = tweepy .OAuthHandler (os .environ ['TWITTER_KEY' ], os .environ ['TWITTER_SECRET' ])
auth .set_access_token (os .environ ['TWITTER_TOKEN' ], os .environ ['TWITTER_TOKEN_SECRET' ])
api = tweepy .API (auth )
# fetch tweets
tweets = api .user_timeline (screen_name = user , count = 200 , include_rts = False )
return tweets
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
require 'twitter'
def fetch_tweets_from_user ( handle )
twitter = Twitter ::REST ::Client . new do |config |
config . consumer_key = ENV [ 'TWITTER_CONSUMER_KEY' ]
config . consumer_secret = ENV [ 'TWITTER_CONSUMER_SECRET' ]
config . access_token = ENV [ 'TWITTER_ACCESS_TOKEN' ]
config . access_token_secret = ENV [ 'TWITTER_ACCESS_TOKEN_SECRET' ]
end
tweets = twitter . user_timeline ( handle )
tweets
end
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
const token = process . env [ "TWITTER_BEARER_TOKEN" ]
const fetchTweetsFromUser = ( userName : string ) => {
const url = `https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=${ userName } &count=20`
return fetch ( url , {
headers : {
"Authorization" : `Bearer ${ token } `
}
} )
. then ( res => res . json ( ) )
. then ( tweets => tweets . map ( tweet => ( {
id : tweet . id ,
text : tweet . text ,
created_at : tweet . created_at ,
user : {
id : tweet . user . id ,
name : tweet . user . name ,
screen_name : tweet . user . screen_name ,
profile_image_url : tweet . user . profile_image_url
}
} ) ) )
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
package main
var apiKey = os .Getenv ("TWITTER_BEARER_TOKEN" )
type Tweet = struct { Text string }
func fetchTweetsFromUser (user string ) ([]Tweet , error ) {
url := "https://api.twitter.com/1.1/statuses/user_timeline.json?screen_name=" + user + "&count=200"
req , err := http .NewRequest ("GET" , url , nil )
if err != nil {
return nil , err
}
req .Header .Set ("Authorization" , "Bearer " + apiKey )
resp , err := http .DefaultClient .Do (req )
if err != nil {
return nil , err
}
defer resp .Body .Close ()
if resp .StatusCode != 200 {
return nil , fmt .Errorf ("bad status: %d" , resp .StatusCode )
}
var tweets []Tweet
if err := json .NewDecoder (resp .Body ).Decode (& tweets ); err != nil {
return nil , err
}
return tweets , nil
}
C o p i l o t
R e p l a y
J a v a S c r i p t
d r a w _ s c a t t e r p l o t . j s
P y t h o n
d r a w _ s c a t t e r p l o t . p y
R u b y
d r a w _ s c a t t e r p l o t . r b
T y p e S c r i p t
d r a w _ s c a t t e r p l o t . t s
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import d3 from "d3"
const drawScatterplot = ( data , height , width ) => {
const svg = d3 . select ( "#scatterplot" )
. append ( "svg" )
. attr ( "height" , height )
. attr ( "width" , width )
svg . selectAll ( "circle" )
. data ( data )
. enter ( )
. append ( "circle" )
. attr ( "cx" , d => d . x )
. attr ( "cy" , d => d . y )
. attr ( "r" , 5 )
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
import matplotlib .pyplot as plt
def draw_scatterplot (x_values , y_values ):
plt .scatter (x_values , y_values , s = 20 )
plt .title ("Scatter Plot" )
plt .xlabel ("x values" )
plt .ylabel ("y values" )
plt .show ()
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
require 'gruff'
def draw_scatterplot ( x_values , y_values )
g = Gruff ::Scatter . new ( 400 )
g . title = "GCD"
g . x_axis_label = "X"
g . y_axis_label = "Y"
g . data ( 'data' , x_values , y_values )
g . write ( "plot.png" )
end
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
import d3 from "d3"
const drawScatterplot = (
data : Array < { x : number ; y : number ; size : number } > ,
x : d3 . ScaleLinear < number , number > ,
y : d3 . ScaleLinear < number , number > ,
svg : d3 . Selection < SVGGElement , unknown , HTMLElement , any > ,
margin : { top : number ; bottom : number ; left : number ; right : number }
) => {
const width = svg . attr ( "width" ) - margin . left - margin . right
const height = svg . attr ( "height" ) - margin . top - margin . bottom
svg . selectAll ( "*" ) . remove ( )
const g = svg . append ( "g" )
. attr ( "transform" , `translate(${ margin . left } , ${ margin . top } )` )
const xAxis = g
. append ( "g" )
. attr ( "transform" , `translate(0, ${ height } )` )
. call ( d3 . axisBottom ( x ) )
. . .
C o p i l o t
R e p l a y
J a v a S c r i p t
m e m o i z e . j s
P y t h o n
m e m o i z e . p y
R u b y
m e m o i z e . r b
T y p e S c r i p t
m e m o i z e . t s
Go
m e m o i z e . g o
1
2
3
4
5
6
7
const memoize = fn => {
const cache = { } ;
return ( ...args ) => {
const key = JSON . stringify ( args ) ;
return ( cache [ key ] = cache [ key ] || fn ( ...args ) ) ;
} ;
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
def memoize (func ):
cache = {}
def wrapper (* args ):
if args in cache :
return cache [args ]
else :
cache [args ] = func (* args )
return cache [args ]
return wrapper
C o p i l o t
R e p l a y
1
2
3
4
def memoize ( func )
cache = { }
lambda { |*args | cache [ args ] ||= func . call ( *args ) }
end
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
const memoize = ( fn : Function ) : Function => {
const cache : { [ key : string ] : any } = { } ;
return ( ...args : any [ ] ) : any => {
const key = JSON . stringify ( args ) ;
if ( cache [ key ] ) {
return cache [ key ] ;
}
const result = fn ( ...args ) ;
cache [ key ] = result ;
return result ;
} ;
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
package main
func Memoize (fn func (int ) int ) func (int ) int {
cache := make (map [int ]int )
return func (n int ) int {
if v , ok := cache [n ]; ok {
return v
}
cache [n ] = fn (n )
return cache [n ]
}
}
C o p i l o t
R e p l a y
J a v a S c r i p t
r a t i n g . j s
P y t h o n
r a t i n g . p y
R u b y
r a t i n g . r b
T y p e S c r i p t
r a t i n g . t s
Go
r a t i n g . g o
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
const https = require ( 'https' )
const parseString = require ( 'xml2js' ) . parseString
const apiKey = process . env [ "GOODREADS_API_KEY" ]
const getRating = title => {
return new Promise ( ( resolve , reject ) => {
https . get ( `https://www.goodreads.com/book/title.xml?key=${ apiKey } &title=${ title } ` , res => {
let xml = ''
res . setEncoding ( 'utf8' )
res . on ( 'data' , chunk => {
xml += chunk
} )
res . on ( 'end' , ( ) => {
parseString ( xml , ( err , result ) => {
if ( err ) {
reject ( err )
} else {
resolve ( result . GoodreadsResponse . book [ 0 ] . average_rating )
}
} )
} )
} )
} )
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
import os , requests , json , bs4
key = os .environ ['GOODREADS_API_KEY' ]
def get_rating (title ) :
"""Get the average rating of the book from GoodReads, and return a float."""
url = 'https://www.goodreads.com/book/title.xml?key=' + key + '&title=' + title
response = requests .get (url )
soup = bs4 .BeautifulSoup (response .text , 'xml' )
rating = soup .find ('average_rating' ).text
return float (rating )
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
require 'goodreads'
def get_rating_of_book_by_title ( title )
client = Goodreads ::Client . new (
api_key : "YOUR_API_KEY" ,
api_secret : "YOUR_API_SECRET"
)
book = client . book ( title )
book . rating
end
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
const apiKey = process . env [ "GOODREADS_API_KEY" ]
const getRating = ( title : string ) => {
return fetch ( `https://www.goodreads.com/book/title.xml?key=${ apiKey } &title=${ title } ` )
. then ( res => res . text ( ) )
. then ( res => {
const parser = new DOMParser ( ) ;
const xml = parser . parseFromString ( res , "text/xml" ) ;
const rating = xml . getElementsByTagName ( "average_rating" ) [ 0 ] . textContent ;
return rating ;
} )
. catch ( error => console . log ( error ) ) ;
}
C o p i l o t
R e p l a y
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import ("log" ; "net/http" ; "net/url" ; "os" ; "strconv" ; "github.com/beevik/etree" )
var (
apiKey = os .Getenv ("GOODREADS_API_KEY" )
)
// GetRating gets the average rating of a book using the Goodreads API.
func GetRating (title string ) (float64 , error ) {
u := url.URL {
Scheme : "https" ,
Host : "www.goodreads.com" ,
Path : "/book/title.xml" ,
RawQuery : url.Values {
"key" : {apiKey },
"title" : {title },
}.Encode (),
}
resp , err := http .Get (u .String ())
if err != nil {
return 0 , err
}
defer resp .Body .Close ()
doc := etree .NewDocument ()
if _ , err := doc .ReadFrom (resp .Body ); err != nil {
return 0 , err
}
ratings := doc .FindElements ("//average_rating" )
if len (ratings ) == 0 {
return 0 , nil
}
rating , err := strconv .ParseFloat (ratings [0 ].Text (), 64 )
if err != nil {
return 0 , err
}
return rating , nil
}
C o p i l o t
R e p l a y
F l i g h t R e p o r t s
H u n d r e d s o f e n g i n e e r s , i n c l u d i n g o u r o w n , u s e G i t H u b C o p i l o t e v e r y d a y .
T h i s i s t h e s i n g l e m o s t m i n d - b l o w i n g a p p l i c a t i o n o f m a c h i n e l e a r n i n g I ’ v e e v e r s e e n .
M i k e K r i e g e r / / C o - f o u n d e r , I n s t a g r a m
”
G i t H u b C o p i l o t w o r k s s h o c k i n g l y w e l l . I w i l l n e v e r d e v e l o p s o f t w a r e w i t h o u t i t a g a i n .
L a r s G y r u p B r i n k N i e l s e n
”
I w a s s t u n n e d w h e n I s t a r t e d w r i t i n g C l o j u r e w i t h G i t H u b C o p i l o t a n d i t f i l l e d a n i d i o m a t i c n a m e s p a c e r e q u i r e , j u s t l i k e I w a s g o i n g t o w r i t e i t .
G u n n i k a B a t r a / / S e n i o r A n a l y s t
”
T r y i n g t o c o d e i n a n u n f a m i l i a r l a n g u a g e b y g o o g l i n g e v e r y t h i n g i s l i k e n a v i g a t i n g a f o r e i g n c o u n t r y w i t h j u s t a p h r a s e b o o k . U s i n g G i t H u b C o p i l o t i s l i k e h i r i n g a n i n t e r p r e t e r .
H a r r i E d w a r d s / / O p e n AI
D o n ' t f l y s o l o
E n j o y a 6 0 - d a y f r e e t r i a l t h e n $ 1 0 / m o n t h o r $ 1 0 0 / y e a r p e r u s e r
S t a r t m y f r e e t r i a l
E x p l o r e d o c s
L e a r n a b o u t G i t H u b C o p i l o t T e r m s a n d C o n d i t i o n s
C o m i n g l a t e r t h i s y e a r
G i t H u b C o p i l o t f o r c o m p a n i e s
J o i n t h e w a i t l i s t
F r e q u e n t l y a s k e d q u e s t i o n s
G e n e r a l
W h a t i s G i t H u b C o p i l o t ?
G i t H u b C o p i l o t i s a n A I p a i r p r o g r a m m e r t h a t h e l p s y o u w r i t e c o d e f a s t e r a n d w i t h l e s s w o r k . I t d r a w s c o n t e x t f r o m c o m m e n t s a n d c o d e t o s u g g e s t i n d i v i d u a l l i n e s a n d w h o l e f u n c t i o n s i n s t a n t l y . G i t H u b C o p i l o t i s p o w e r e d b y C o d e x , a g e n e r a t i v e p r e t r a i n e d l a n g u a g e m o d e l c r e a t e d b y O p e n A I . I t i s a v a i l a b l e a s a n e x t e n s i o n f o r V i s u a l S t u d i o C o d e , V i s u a l S t u d i o , N e o v i m , a n d t h e J e t B r a i n s s u i t e o f i n t e g r a t e d d e v e l o p m e n t e n v i r o n m e n t s ( I D E s ) .
G i t H u b C o p i l o t i s n o t i n t e n d e d f o r n o n - c o d i n g t a s k s l i k e d a t a g e n e r a t i o n a n d n a t u r a l l a n g u a g e g e n e r a t i o n , l i k e q u e s t i o n & a n s w e r i n g . Y o u r u s e o f G i t H u b C o p i l o t i s s u b j e c t t o t h e G i t H u b T e r m s f o r A d d i t i o n a l P r o d u c t a n d F e a t u r e s .
H o w d o e s G i t H u b C o p i l o t w o r k ?
O p e n A I C o d e x w a s t r a i n e d o n p u b l i c l y a v a i l a b l e s o u r c e c o d e a n d n a t u r a l l a n g u a g e , s o i t w o r k s f o r b o t h p r o g r a m m i n g a n d h u m a n l a n g u a g e s . T h e G i t H u b C o p i l o t e x t e n s i o n s e n d s y o u r c o m m e n t s a n d c o d e t o t h e G i t H u b C o p i l o t s e r v i c e , a n d i t r e l i e s o n c o n t e x t , a s d e s c r i b e d i n P r i v a c y b e l o w - i . e . , f i l e c o n t e n t b o t h i n t h e f i l e y o u a r e e d i t i n g , a s w e l l a s n e i g h b o r i n g o r r e l a t e d f i l e s w i t h i n a p r o j e c t . I t m a y a l s o c o l l e c t t h e U R L s o f r e p o s i t o r i e s o r f i l e p a t h s t o i d e n t i f y r e l e v a n t c o n t e x t . T h e c o m m e n t s a n d c o d e a l o n g w i t h c o n t e x t a r e t h e n u s e d b y O p e n A I C o d e x t o s y n t h e s i z e a n d s u g g e s t i n d i v i d u a l l i n e s a n d w h o l e f u n c t i o n s .
W h a t d a t a h a s G i t H u b C o p i l o t b e e n t r a i n e d o n ?
G i t H u b C o p i l o t i s p o w e r e d b y C o d e x , a g e n e r a t i v e p r e t r a i n e d A I m o d e l c r e a t e d b y O p e n A I . I t h a s b e e n t r a i n e d o n n a t u r a l l a n g u a g e t e x t a n d s o u r c e c o d e f r o m p u b l i c l y a v a i l a b l e s o u r c e s , i n c l u d i n g c o d e i n p u b l i c r e p o s i t o r i e s o n G i t H u b .
D o e s G i t H u b C o p i l o t w r i t e p e r f e c t c o d e ?
I n a r e c e n t e v a l u a t i o n , w e f o u n d t h a t u s e r s a c c e p t e d o n a v e r a g e 2 6 % o f a l l c o m p l e t i o n s s h o w n b y G i t H u b C o p i l o t . W e a l s o f o u n d t h a t o n a v e r a g e m o r e t h a n 2 7 % o f d e v e l o p e r s ’ c o d e f i l e s w e r e g e n e r a t e d b y G i t H u b C o p i l o t , a n d i n c e r t a i n l a n g u a g e s l i k e P y t h o n t h a t g o e s u p t o 4 0 % . H o w e v e r , G i t H u b C o p i l o t d o e s n o t w r i t e p e r f e c t c o d e . I t i s d e s i g n e d t o g e n e r a t e t h e b e s t c o d e p o s s i b l e g i v e n t h e c o n t e x t i t h a s a c c e s s t o , b u t i t d o e s n ’ t t e s t t h e c o d e i t s u g g e s t s s o t h e c o d e m a y n o t a l w a y s w o r k , o r e v e n m a k e s e n s e . G i t H u b C o p i l o t c a n o n l y h o l d a v e r y l i m i t e d c o n t e x t , s o i t m a y n o t m a k e u s e o f h e l p f u l f u n c t i o n s d e f i n e d e l s e w h e r e i n y o u r p r o j e c t o r e v e n i n t h e s a m e f i l e . A n d i t m a y s u g g e s t o l d o r d e p r e c a t e d u s e s o f l i b r a r i e s a n d l a n g u a g e s . W h e n c o n v e r t i n g c o m m e n t s w r i t t e n i n n o n - E n g l i s h t o c o d e , t h e r e m a y b e p e r f o r m a n c e d i s p a r i t i e s w h e n c o m p a r e d t o E n g l i s h . F o r s u g g e s t e d c o d e , c e r t a i n l a n g u a g e s l i k e P y t h o n , J a v a S c r i p t , T y p e S c r i p t , a n d G o m i g h t p e r f o r m b e t t e r c o m p a r e d t o o t h e r p r o g r a m m i n g l a n g u a g e s .
L i k e a n y o t h e r c o d e , c o d e s u g g e s t e d b y G i t H u b C o p i l o t s h o u l d b e c a r e f u l l y t e s t e d , r e v i e w e d , a n d v e t t e d . A s t h e d e v e l o p e r , y o u a r e a l w a y s i n c h a r g e .
W i l l G i t H u b C o p i l o t h e l p m e w r i t e c o d e f o r a n e w p l a t f o r m ?
G i t H u b C o p i l o t i s t r a i n e d o n p u b l i c c o d e . W h e n a n e w l i b r a r y , f r a m e w o r k , o r A P I i s r e l e a s e d , t h e r e i s l e s s p u b l i c c o d e a v a i l a b l e f o r t h e m o d e l t o l e a r n f r o m . T h a t r e d u c e s G i t H u b C o p i l o t ’ s a b i l i t y t o p r o v i d e s u g g e s t i o n s f o r t h e n e w c o d e b a s e . A s m o r e e x a m p l e s e n t e r t h e p u b l i c s p a c e , w e i n t e g r a t e t h e m i n t o t h e t r a i n i n g s e t a n d s u g g e s t i o n r e l e v a n c e i m p r o v e s . I n t h e f u t u r e , w e w i l l p r o v i d e w a y s t o h i g h l i g h t n e w e r A P I s a n d s a m p l e s t o r a i s e t h e i r r e l e v a n c e i n G i t H u b C o p i l o t ’ s s u g g e s t i o n s .
H o w d o I g e t t h e m o s t o u t o f G i t H u b C o p i l o t ?
G i t H u b C o p i l o t w o r k s b e s t w h e n y o u d i v i d e y o u r c o d e i n t o s m a l l f u n c t i o n s , u s e m e a n i n g f u l n a m e s f o r f u n c t i o n s p a r a m e t e r s , a n d w r i t e g o o d d o c s t r i n g s a n d c o m m e n t s a s y o u g o . I t a l s o s e e m s t o d o b e s t w h e n i t ’ s h e l p i n g y o u n a v i g a t e u n f a m i l i a r l i b r a r i e s o r f r a m e w o r k s .
H o w c a n I c o n t r i b u t e ?
B y u s i n g G i t H u b C o p i l o t a n d s h a r i n g y o u r f e e d b a c k i n t h e f e e d b a c k f o r u m , y o u h e l p t o i m p r o v e G i t H u b C o p i l o t . P l e a s e a l s o r e p o r t i n c i d e n t s ( e . g . , o f f e n s i v e o u t p u t , c o d e v u l n e r a b i l i t i e s , a p p a r e n t p e r s o n a l i n f o r m a t i o n i n c o d e g e n e r a t i o n ) d i r e c t l y t o c o p i l o t - s a f e t y @ g i t h u b . c o m s o t h a t w e c a n i m p r o v e o u r s a f e g u a r d s . G i t H u b t a k e s s a f e t y a n d s e c u r i t y v e r y s e r i o u s l y a n d w e a r e c o m m i t t e d t o c o n t i n u a l l y i m p r o v i n g .
H u m a n o v e r s i g h t
C a n G i t H u b C o p i l o t i n t r o d u c e i n s e c u r e c o d e i n i t s s u g g e s t i o n s ?
P u b l i c c o d e m a y c o n t a i n i n s e c u r e c o d i n g p a t t e r n s , b u g s , o r r e f e r e n c e s t o o u t d a t e d A P I s o r i d i o m s . W h e n G i t H u b C o p i l o t s y n t h e s i z e s c o d e s u g g e s t i o n s b a s e d o n t h i s d a t a , i t c a n a l s o s y n t h e s i z e c o d e t h a t c o n t a i n s t h e s e u n d e s i r a b l e p a t t e r n s . T h i s i s s o m e t h i n g w e c a r e a l o t a b o u t a t G i t H u b , a n d i n r e c e n t y e a r s w e ’ v e p r o v i d e d t o o l s s u c h a s G i t H u b A c t i o n s , D e p e n d a b o t , a n d C o d e Q L t o o p e n s o u r c e p r o j e c t s t o h e l p i m p r o v e c o d e q u a l i t y . O f c o u r s e , y o u s h o u l d a l w a y s u s e G i t H u b C o p i l o t t o g e t h e r w i t h g o o d t e s t i n g a n d c o d e r e v i e w p r a c t i c e s a n d s e c u r i t y t o o l s , a s w e l l a s y o u r o w n j u d g m e n t .
D o e s G i t H u b o w n t h e c o d e g e n e r a t e d b y G i t H u b C o p i l o t ?
G i t H u b C o p i l o t i s a t o o l , l i k e a c o m p i l e r o r a p e n . G i t H u b d o e s n o t o w n t h e s u g g e s t i o n s G i t H u b C o p i l o t g e n e r a t e s . T h e c o d e y o u w r i t e w i t h G i t H u b C o p i l o t ’ s h e l p b e l o n g s t o y o u , a n d y o u a r e r e s p o n s i b l e f o r i t . W e r e c o m m e n d t h a t y o u c a r e f u l l y t e s t , r e v i e w , a n d v e t t h e c o d e b e f o r e p u s h i n g i t t o p r o d u c t i o n , a s y o u w o u l d w i t h a n y c o d e y o u w r i t e t h a t i n c o r p o r a t e s m a t e r i a l y o u d i d n o t i n d e p e n d e n t l y o r i g i n a t e .
D o e s G i t H u b C o p i l o t r e c i t e c o d e f r o m t h e t r a i n i n g s e t ?
T h e v a s t m a j o r i t y o f t h e c o d e t h a t G i t H u b C o p i l o t s u g g e s t s h a s n e v e r b e e n s e e n b e f o r e . O u r l a t e s t i n t e r n a l r e s e a r c h s h o w s t h a t a b o u t 1 % o f t h e t i m e , a s u g g e s t i o n m a y c o n t a i n s o m e c o d e s n i p p e t s l o n g e r t h a n ~ 1 5 0 c h a r a c t e r s t h a t m a t c h e s t h e t r a i n i n g s e t . P r e v i o u s r e s e a r c h s h o w e d t h a t m a n y o f t h e s e c a s e s h a p p e n w h e n G i t H u b C o p i l o t i s u n a b l e t o g l e a n s u f f i c i e n t c o n t e x t f r o m t h e c o d e y o u a r e w r i t i n g , o r w h e n t h e r e i s a c o m m o n , p e r h a p s e v e n u n i v e r s a l , s o l u t i o n t o t h e p r o b l e m .
W h a t c a n I d o t o r e d u c e G i t H u b C o p i l o t ’ s s u g g e s t i o n o f c o d e t h a t m a t c h e s p u b l i c c o d e ?
W e b u i l t a f i l t e r t o h e l p d e t e c t a n d s u p p r e s s t h e r a r e i n s t a n c e s w h e r e a G i t H u b C o p i l o t s u g g e s t i o n c o n t a i n s c o d e t h a t m a t c h e s p u b l i c c o d e o n G i t H u b . Y o u h a v e t h e c h o i c e t o t u r n t h a t f i l t e r o n o r o f f d u r i n g s e t u p . W i t h t h e f i l t e r o n , G i t H u b C o p i l o t c h e c k s c o d e s u g g e s t i o n s w i t h i t s s u r r o u n d i n g c o d e f o r m a t c h e s o r n e a r m a t c h e s ( i g n o r i n g w h i t e s p a c e ) a g a i n s t p u b l i c c o d e o n G i t H u b o f a b o u t 1 5 0 c h a r a c t e r s . I f t h e r e i s a m a t c h , t h e s u g g e s t i o n w i l l n o t b e s h o w n t o y o u . W e p l a n o n c o n t i n u i n g t o e v o l v e t h i s a p p r o a c h a n d w e l c o m e f e e d b a c k a n d c o m m e n t .
O t h e r t h a n t h e f i l t e r , w h a t o t h e r m e a s u r e s c a n I t a k e t o a s s e s s c o d e s u g g e s t e d b y G i t H u b C o p i l o t ?
Y o u s h o u l d t a k e t h e s a m e p r e c a u t i o n s a s y o u w o u l d w i t h a n y c o d e y o u w r i t e t h a t u s e s m a t e r i a l y o u d i d n o t i n d e p e n d e n t l y o r i g i n a t e . T h e s e i n c l u d e r i g o r o u s t e s t i n g , I P s c a n n i n g , a n d c h e c k i n g f o r s e c u r i t y v u l n e r a b i l i t i e s . Y o u s h o u l d m a k e s u r e y o u r I D E o r e d i t o r d o e s n o t a u t o m a t i c a l l y c o m p i l e o r r u n g e n e r a t e d c o d e b e f o r e y o u r e v i e w i t .
F a i r n e s s a n d b r o a d e r i m p a c t
W i l l d i f f e r e n t p e o p l e e x p e r i e n c e d i f f e r e n t q u a l i t y o f s e r v i c e f r o m G i t H u b C o p i l o t ?
G i v e n p u b l i c s o u r c e s a r e p r e d o m i n a n t l y i n E n g l i s h , G i t H u b C o p i l o t w i l l l i k e l y w o r k l e s s w e l l i n s c e n a r i o s w h e r e n a t u r a l l a n g u a g e p r o m p t s p r o v i d e d b y t h e d e v e l o p e r a r e n o t i n E n g l i s h a n d / o r a r e g r a m m a t i c a l l y i n c o r r e c t . T h e r e f o r e , n o n - E n g l i s h s p e a k e r s m i g h t e x p e r i e n c e a l o w e r q u a l i t y o f s e r v i c e .
A d d i t i o n a l l y , i n e x p e r i e n c e d d e v e l o p e r s m a y s t r u g g l e t o u s e G i t H u b C o p i l o t t o e f f e c t i v e l y g e n e r a t e c o d e , a n d t h e i r l a c k o f e x p e r i e n c e m i g h t i n h i b i t t h e i r c a p a b i l i t y t o e f f e c t i v e l y r e v i e w a n d e d i t s u g g e s t i o n s m a d e b y G i t H u b C o p i l o t . F i n a l l y , w e a r e c o n d u c t i n g i n t e r n a l t e s t i n g o f G i t H u b C o p i l o t ’ s e a s e o f u s e b y d e v e l o p e r s w i t h d i s a b i l i t i e s a n d w o r k i n g t o e n s u r e t h a t G i t H u b C o p i l o t i s a c c e s s i b l e t o a l l d e v e l o p e r s . P l e a s e f e e l f r e e t o s h a r e y o u r f e e d b a c k o n G i t H u b C o p i l o t a c c e s s i b i l i t y i n o u r f e e d b a c k f o r u m .
W e a c k n o w l e d g e t h a t f a i r n e s s a n d i n c l u s i v i t y i n c o d e g e n e r a t i o n s y s t e m s a r e i m p o r t a n t e m e r g i n g r e s e a r c h a r e a s . W e a r e w o r k i n g w i t h e x p e r t s , i n c l u d i n g M i c r o s o f t ’ s O f f i c e o f R e s p o n s i b l e A I , i n a n e f f o r t t o a d v a n c e G i t H u b C o p i l o t ’ s r e s p o n s i b l e A I p r a c t i c e s . W e w i l l a l s o r e v i e w n e w r e s e a r c h a n d l e a r n f r o m f e e d b a c k w e r e c e i v e t o i m p r o v e G i t H u b C o p i l o t s u c h t h a t i t i s u s a b l e b y a w i d e r a n g e o f d e v e l o p e r s a n d p r o v i d e s s i m i l a r q u a l i t y o f s e r v i c e t o p e o p l e w i t h d i f f e r e n t b a c k g r o u n d s .
D o e s G i t H u b C o p i l o t p r o d u c e o f f e n s i v e o u t p u t s ?
G i t H u b C o p i l o t i n c l u d e s f i l t e r s t o b l o c k o f f e n s i v e l a n g u a g e i n t h e p r o m p t s a n d t o a v o i d s y n t h e s i z i n g s u g g e s t i o n s i n s e n s i t i v e c o n t e x t s . W e c o n t i n u e t o w o r k o n i m p r o v i n g t h e f i l t e r s y s t e m t o m o r e i n t e l l i g e n t l y d e t e c t a n d r e m o v e o f f e n s i v e o u t p u t s . H o w e v e r , d u e t o t h e n o v e l s p a c e o f c o d e s a f e t y , G i t H u b C o p i l o t m a y s o m e t i m e s p r o d u c e u n d e s i r e d o u t p u t . I f y o u s e e o f f e n s i v e o u t p u t s , p l e a s e r e p o r t t h e m d i r e c t l y t o c o p i l o t - s a f e t y @ g i t h u b . c o m s o t h a t w e c a n i m p r o v e o u r s a f e g u a r d s . G i t H u b t a k e s t h i s c h a l l e n g e v e r y s e r i o u s l y a n d w e a r e c o m m i t t e d t o a d d r e s s i n g i t .
H o w w i l l a d v a n c e d c o d e g e n e r a t i o n t o o l s l i k e G i t H u b C o p i l o t a f f e c t d e v e l o p e r j o b s ?
B r i n g i n g i n m o r e i n t e l l i g e n t s y s t e m s h a s t h e p o t e n t i a l t o b r i n g e n o r m o u s c h a n g e t o t h e d e v e l o p e r e x p e r i e n c e . W e d o n o t e x p e c t G i t H u b C o p i l o t t o r e p l a c e d e v e l o p e r s . R a t h e r , w e e x p e c t G i t H u b C o p i l o t t o p a r t n e r w i t h d e v e l o p e r s , a u g m e n t t h e i r c a p a b i l i t i e s , a n d e n a b l e t h e m t o b e m o r e p r o d u c t i v e , r e d u c e m a n u a l t a s k s , a n d h e l p t h e m f o c u s o n i n t e r e s t i n g w o r k . W e a l s o b e l i e v e t h a t G i t H u b C o p i l o t h a s t h e p o t e n t i a l t o l o w e r b a r r i e r s t o e n t r y , e n a b l i n g m o r e p e o p l e t o e x p l o r e s o f t w a r e d e v e l o p m e n t , a n d j o i n t h e n e x t g e n e r a t i o n o f d e v e l o p e r s . W e a r e w o r k i n g t o t e s t t h e s e h y p o t h e s e s w i t h b o t h i n t e r n a l a n d e x t e r n a l r e s e a r c h .
P r i v a c y
H o w c a n I c o n t r o l t h e u s e o f m y d a t a c o l l e c t e d b y C o p i l o t ?
G i t H u b C o p i l o t g i v e s y o u c e r t a i n c h o i c e s a b o u t h o w i t u s e s t h e d a t a i t c o l l e c t s . U s e r e n g a g e m e n t d a t a , i n c l u d i n g p s e u d o n y m o u s i d e n t i f i e r s a n d g e n e r a l u s a g e d a t a , i s r e q u i r e d f o r t h e u s e o f G i t H u b C o p i l o t a n d w i l l c o n t i n u e t o b e c o l l e c t e d , p r o c e s s e d , a n d s h a r e d w i t h M i c r o s o f t a n d O p e n A I a s y o u u s e G i t H u b C o p i l o t . Y o u c a n c h o o s e w h e t h e r y o u r c o d e s n i p p e t s a r e c o l l e c t e d a n d r e t a i n e d b y G i t H u b a n d f u r t h e r p r o c e s s e d a n d s h a r e d w i t h M i c r o s o f t a n d O p e n A I b y a d j u s t i n g y o u r u s e r s e t t i n g s . A d d i t i o n a l i n f o r m a t i o n a b o u t t h e t y p e s o f t e l e m e t r y c o l l e c t e d a n d p r o c e s s e d b y G i t H u b C o p i l o t c a n b e f o u n d i n W h a t d a t a d o e s G i t H u b C o p i l o t c o l l e c t ? b e l o w .
Y o u c a n a l s o r e q u e s t d e l e t i o n o f G i t H u b C o p i l o t d a t a a s s o c i a t e d w i t h y o u r G i t H u b i d e n t i t y b y f i l l i n g o u t a s u p p o r t t i c k e t . P l e a s e n o t e t h a t f u t u r e d a t a c o l l e c t i o n w i l l o c c u r w i t h c o n t i n u e d u s e o f G i t H u b C o p i l o t , b u t y o u c a n c o n t r o l w h e t h e r y o u r c o d e s n i p p e t s a r e c o l l e c t e d , p r o c e s s e d , a n d r e t a i n e d i n t e l e m e t r y i n y o u r C o p i l o t u s e r s e t t i n g s .
W h a t d a t a d o e s G i t H u b C o p i l o t c o l l e c t ?
G i t H u b C o p i l o t r e l i e s o n f i l e c o n t e n t a n d a d d i t i o n a l d a t a t o w o r k . I t c o l l e c t s d a t a b o t h t o p r o v i d e t h e s e r v i c e a n d s a v e s s o m e o f t h e d a t a t o p e r f o r m f u r t h e r a n a l y s i s a n d e n a b l e i m p r o v e m e n t s . P l e a s e s e e b e l o w f o r m o r e d e t a i l s o n h o w y o u r t e l e m e t r y d a t a i s u s e d a n d s h a r e d .
U s e r E n g a g e m e n t D a t a
W h e n y o u u s e G i t H u b C o p i l o t i t w i l l c o l l e c t u s a g e i n f o r m a t i o n a b o u t e v e n t s g e n e r a t e d w h e n i n t e r a c t i n g w i t h t h e I D E o r e d i t o r . T h e s e e v e n t s i n c l u d e u s e r e d i t a c t i o n s l i k e c o m p l e t i o n s a c c e p t e d a n d d i s m i s s e d , a n d e r r o r a n d g e n e r a l u s a g e d a t a t o i d e n t i f y m e t r i c s l i k e l a t e n c y a n d f e a t u r e s e n g a g e m e n t . T h i s i n f o r m a t i o n m a y i n c l u d e p e r s o n a l d a t a , s u c h a s p s e u d o n y m o u s i d e n t i f i e r s .
C o d e S n i p p e t s D a t a
D e p e n d i n g o n y o u r p r e f e r r e d t e l e m e t r y s e t t i n g s , G i t H u b C o p i l o t m a y a l s o c o l l e c t a n d r e t a i n t h e f o l l o w i n g , c o l l e c t i v e l y r e f e r r e d t o a s “ c o d e s n i p p e t s ” : s o u r c e c o d e t h a t y o u a r e e d i t i n g , r e l a t e d f i l e s a n d o t h e r f i l e s o p e n i n t h e s a m e I D E o r e d i t o r , U R L s o f r e p o s i t o r i e s a n d f i l e s p a t h s .
H o w i s G i t H u b C o p i l o t t e l e m e t r y d a t a u s e d a n d s h a r e d ?
T e l e m e t r y i n c l u d i n g c o d e s n i p p e t s , a s d e t a i l e d i n W h a t d a t a d o e s G i t H u b C o p i l o t c o l l e c t ? , a r e u s e d b y G i t H u b , M i c r o s o f t , a n d O p e n A I t o i m p r o v e G i t H u b C o p i l o t a n d r e l a t e d s e r v i c e s a n d t o c o n d u c t p r o d u c t a n d a c a d e m i c r e s e a r c h a b o u t d e v e l o p e r s .
T e l e m e t r y u s e s m a y i n c l u d e :
● D i r e c t l y i m p r o v i n g G i t H u b C o p i l o t , i n c l u d i n g a s s e s s i n g d i f f e r e n t s t r a t e g i e s i n p r o c e s s i n g a n d p r e d i c t i n g w h i c h s u g g e s t i o n s u s e r s m a y f i n d h e l p f u l
● D e v e l o p i n g a n d i m p r o v i n g c l o s e l y r e l a t e d d e v e l o p e r p r o d u c t s a n d s e r v i c e s f r o m G i t H u b , M i c r o s o f t , a n d O p e n A I
● I n v e s t i g a t i n g a n d d e t e c t i n g p o t e n t i a l a b u s e o f G i t H u b C o p i l o t
● C o n d u c t i n g e x p e r i m e n t s a n d r e s e a r c h r e l a t e d t o d e v e l o p e r s a n d t h e i r u s e o f d e v e l o p e r t o o l s a n d s e r v i c e s
● E v a l u a t i n g G i t H u b C o p i l o t , e . g . , b y m e a s u r i n g t h e p o s i t i v e i m p a c t i t h a s o n t h e u s e r
● I m p r o v i n g t h e u n d e r l y i n g c o d e g e n e r a t i o n m o d e l s , e . g . , b y p r o v i d i n g p o s i t i v e a n d n e g a t i v e e x a m p l e s
● F i n e t u n i n g r a n k i n g a n d s o r t i n g a l g o r i t h m s a n d p r o m p t c r a f t i n g
W h e n p r o c e s s i n g c o d e s n i p p e t s , w e t a k e t h e p r o t e c t i o n m e a s u r e s d e s c r i b e d b e l o w i n H o w i s t h e t r a n s m i t t e d d a t a p r o t e c t e d ? a n d f o l l o w r e s p o n s i b l e p r a c t i c e s i n a c c o r d a n c e w i t h o u r P r i v a c y S t a t e m e n t s o t h a t t h e u s e o f y o u r t e l e m e t r y d a t a t o i m p r o v e t h e s e m o d e l s d o e s n o t r e s u l t i n t h i s d a t a b e i n g s h a r e d w i t h o t h e r G i t H u b C o p i l o t u s e r s .
H o w i s t h e t r a n s m i t t e d d a t a p r o t e c t e d ?
W e k n o w t h a t u s e r e d i t a c t i o n s , s o u r c e c o d e s n i p p e t s , a n d U R L s o f r e p o s i t o r i e s a n d f i l e p a t h s a r e s e n s i t i v e d a t a . C o n s e q u e n t l y , s e v e r a l m e a s u r e s o f p r o t e c t i o n a r e a p p l i e d , i n c l u d i n g :
● T h e t r a n s m i t t e d d a t a i s e n c r y p t e d i n t r a n s i t a n d a t r e s t
● A c c e s s i s s t r i c t l y c o n t r o l l e d . T h e d a t a c a n o n l y b e a c c e s s e d b y ( 1 ) n a m e d G i t H u b p e r s o n n e l w o r k i n g o n t h e G i t H u b C o p i l o t t e a m o r o n t h e G i t H u b p l a t f o r m h e a l t h t e a m , ( 2 ) M i c r o s o f t p e r s o n n e l w o r k i n g o n o r w i t h t h e G i t H u b C o p i l o t t e a m , a n d ( 3 ) O p e n A I p e r s o n n e l w h o w o r k o n G i t H u b C o p i l o t
● R o l e - b a s e d a c c e s s c o n t r o l s a n d m u l t i - f a c t o r a u t h e n t i c a t i o n a r e r e q u i r e d f o r p e r s o n n e l a c c e s s i n g c o d e s n i p p e t d a t a
W i l l m y p r i v a t e c o d e b e s h a r e d w i t h o t h e r u s e r s ?
N o . W e u s e d a t a , i n c l u d i n g i n f o r m a t i o n a b o u t w h i c h s u g g e s t i o n s u s e r s a c c e p t o r r e j e c t , t o i m p r o v e t h e m o d e l . W e f o l l o w r e s p o n s i b l e p r a c t i c e s i n a c c o r d a n c e w i t h o u r P r i v a c y S t a t e m e n t t o e n s u r e t h a t y o u r c o d e s n i p p e t s w i l l n o t b e u s e d a s s u g g e s t e d c o d e f o r o t h e r u s e r s o f G i t H u b C o p i l o t .
D o e s G i t H u b C o p i l o t e v e r o u t p u t p e r s o n a l d a t a ?
B e c a u s e G i t H u b C o p i l o t w a s t r a i n e d o n p u b l i c l y a v a i l a b l e c o d e , i t s t r a i n i n g s e t i n c l u d e d p u b l i c p e r s o n a l d a t a i n c l u d e d i n t h a t c o d e . F r o m o u r i n t e r n a l t e s t i n g , w e f o u n d i t t o b e r a r e t h a t G i t H u b C o p i l o t s u g g e s t i o n s i n c l u d e d p e r s o n a l d a t a v e r b a t i m f r o m t h e t r a i n i n g s e t . I n s o m e c a s e s , t h e m o d e l w i l l s u g g e s t w h a t a p p e a r s t o b e p e r s o n a l d a t a – e m a i l a d d r e s s e s , p h o n e n u m b e r s , e t c . – b u t i s a c t u a l l y f i c t i t i o u s i n f o r m a t i o n s y n t h e s i z e d f r o m p a t t e r n s i n t r a i n i n g d a t a . F o r e x a m p l e , w h e n o n e o f o u r e n g i n e e r s p r o m p t e d G i t H u b C o p i l o t w i t h , “ M y n a m e i s M o n a a n d m y b i r t h d a t e i s , ” G i t H u b C o p i l o t s u g g e s t e d a r a n d o m , f i c t i t i o u s d a t e o f “ D e c e m b e r 1 2 , ” w h i c h i s n o t M o n a ’ s a c t u a l b i r t h d a t e . W e h a v e i m p l e m e n t e d a f i l t e r t h a t b l o c k s e m a i l s w h e n s h o w n i n s t a n d a r d f o r m a t s , b u t i t ’ s s t i l l p o s s i b l e t o g e t t h e m o d e l t o s u g g e s t t h i s s o r t o f c o n t e n t i f y o u t r y h a r d e n o u g h . W e w i l l k e e p i m p r o v i n g t h e f i l t e r s y s t e m t o b e m o r e i n t e l l i g e n t t o d e t e c t a n d r e m o v e m o r e p e r s o n a l d a t a f r o m t h e s u g g e s t i o n s .
W h e r e c a n I l e a r n m o r e a b o u t G i t H u b P r i v a c y a n d d a t a p r o t e c t i o n ?
F o r m o r e i n f o r m a t i o n o n h o w G i t H u b p r o c e s s e s a n d u s e s p e r s o n a l d a t a , p l e a s e s e e o u r P r i v a c y S t a t e m e n t .
P r o d u c t
●
F e a t u r e s
●
S e c u r i t y
●
T e a m
●
E n t e r p r i s e
●
C u s t o m e r s t o r i e s
●
T h e R e a d M E P r o j e c t
●
P r i c i n g
●
R e s o u r c e s
●
R o a d m a p
P l a t f o r m
●
D e v e l o p e r A P I
●
P a r t n e r s
●
E l e c t r o n
●
G i t H u b D e s k t o p
S u p p o r t
●
D o c s
●
C o m m u n i t y F o r u m
●
P r o f e s s i o n a l S e r v i c e s
●
S k i l l s
●
S t a t u s
●
C o n t a c t G i t H u b
C o m p a n y
●
A b o u t
●
B l o g
●
C a r e e r s
●
P r e s s
●
I n c l u s i o n
●
S o c i a l I m p a c t
●
S h o p
●
G i t H u b o n T w i t t e r
●
G i t H u b o n F a c e b o o k
●
G i t H u b o n L i n k e d I n
●
G i t H u b o n Y o u T u b e
●
G i t H u b o n T w i t c h
●
G i t H u b o n T i k T o k
●
G i t H u b ’ s o r g a n i z a t i o n o n G i t H u b
●
© 2 0 2 2 G i t H u b , I n c .
●
T e r m s
●
P r i v a c y
( U p d a t e d 0 8 / 2 0 2 2 )
●
S i t e M a p
●
W h a t i s G i t ?
Y o u c a n ’ t p e r f o r m t h a t a c t i o n a t t h i s t i m e .
Y o u s i g n e d i n w i t h a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .
Y o u s i g n e d o u t i n a n o t h e r t a b o r w i n d o w . R e l o a d t o r e f r e s h y o u r s e s s i o n .